file-explorer-note-count icon indicating copy to clipboard operation
file-explorer-note-count copied to clipboard

Add option to hide vault count

Open nimide opened this issue 2 years ago • 4 comments

nimide avatar Jan 26 '23 19:01 nimide

I'm interested in this too.

AaronKnowls avatar Aug 10 '23 06:08 AaronKnowls

Got me interested in this too.

hatredholder avatar Feb 06 '24 18:02 hatredholder

If anyone wants to do it themselves, here's the code you need to change in main.js

const setCount = (item, filter) => {
    // if (item.file.isRoot()) return;
    const count = countFolderChildren(item.file, filter);
    item.selfEl.dataset['count'] = count.toString();
    item.selfEl.toggleClass(withSubfolderClass, Array.isArray(item.file.children) &&
        item.file.children.some((af) => af instanceof obsidian.TFolder));
};

to

const setCount = (item, filter) => {
    if (item.file.isRoot()) return;
    const count = countFolderChildren(item.file, filter);
    item.selfEl.dataset['count'] = count.toString();
    item.selfEl.toggleClass(withSubfolderClass, Array.isArray(item.file.children) &&
        item.file.children.some((af) => af instanceof obsidian.TFolder));
};

Just uncomment the second line in setCount function

hatredholder avatar Feb 06 '24 18:02 hatredholder

If anyone wants to do it themselves, here's the code you need to change in main.js

const setCount = (item, filter) => {
    // if (item.file.isRoot()) return;
    const count = countFolderChildren(item.file, filter);
    item.selfEl.dataset['count'] = count.toString();
    item.selfEl.toggleClass(withSubfolderClass, Array.isArray(item.file.children) &&
        item.file.children.some((af) => af instanceof obsidian.TFolder));
};

to

const setCount = (item, filter) => {
    if (item.file.isRoot()) return;
    const count = countFolderChildren(item.file, filter);
    item.selfEl.dataset['count'] = count.toString();
    item.selfEl.toggleClass(withSubfolderClass, Array.isArray(item.file.children) &&
        item.file.children.some((af) => af instanceof obsidian.TFolder));
};

Just uncomment the second line in setCount function

Thanks!

AaronKnowls avatar Feb 10 '24 09:02 AaronKnowls