mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Hide collapse icon storage location difference
This commit is contained in:
parent
518bf64c29
commit
cfbee6a814
1 changed files with 4 additions and 3 deletions
|
|
@ -165,10 +165,11 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
let attachmentFolderPath = this.app.vault.getConfig('attachmentFolderPath') as string;
|
||||
const cleanAttachmentFolderPath = attachmentFolderPath?.replace('./', '') || '';
|
||||
const attachmentsAreInRootFolder = attachmentFolderPath === './' || attachmentFolderPath === '';
|
||||
const threshold = this.settings.storageLocation === 'insideFolder' ? 1 : 0;
|
||||
|
||||
if (folder.children.length == 1) {
|
||||
if (folder.children.length == threshold) {
|
||||
return true;
|
||||
} else if (folder.children.length > 1) {
|
||||
} else if (folder.children.length > threshold) {
|
||||
if (attachmentsAreInRootFolder) {
|
||||
return false;
|
||||
} else if (this.settings.ignoreAttachmentFolder && this.app.vault.getAbstractFileByPath(`${folder.path}/${cleanAttachmentFolderPath}`)) {
|
||||
|
|
@ -178,7 +179,7 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
if (!folder.collapsed) {
|
||||
getEl(folder.path)?.click();
|
||||
}
|
||||
return folder.children.length <= 2;
|
||||
return folder.children.length <= threshold + 1;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue