mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Fixed front matter title plugin bugs
This commit is contained in:
parent
b9f5c63011
commit
d7423a148b
2 changed files with 5 additions and 4 deletions
|
|
@ -60,7 +60,7 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
const folderPath = path.slice(0, -1);
|
||||
breadcrumb.setAttribute('data-path', folderPath);
|
||||
const folder = this.fmtpHandler?.modifiedFolders.get(folderPath);
|
||||
if (folder) {
|
||||
if (folder && this.settings.frontMatterTitle.path && this.settings.frontMatterTitle.enabled) {
|
||||
breadcrumb.setAttribute('old-name', folder.name || '');
|
||||
breadcrumb.innerText = folder.newName || '';
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
}
|
||||
fileExplorerItem = fileExplorerItem.querySelector('div.nav-folder-title-content')
|
||||
if (!fileExplorerItem) { return; }
|
||||
if (this.settings.frontMatterTitle.explorer) {
|
||||
if (this.settings.frontMatterTitle.explorer && this.settings.frontMatterTitle.enabled) {
|
||||
fileExplorerItem.innerText = name;
|
||||
fileExplorerItem.setAttribute('old-name', folder.name);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -403,6 +403,9 @@ export class SettingsTab extends PluginSettingTab {
|
|||
if (this.plugin.fmtpHandler) {
|
||||
this.plugin.updateBreadcrumbs(true);
|
||||
}
|
||||
this.plugin.app.vault.getFiles().forEach((file) => {
|
||||
this.plugin.fmtpHandler?.handleRename({ id: '', result: false, path: file.path }, false);
|
||||
});
|
||||
this.plugin.fmtpHandler?.deleteEvent();
|
||||
this.plugin.fmtpHandler = null;
|
||||
}
|
||||
|
|
@ -423,7 +426,6 @@ export class SettingsTab extends PluginSettingTab {
|
|||
this.plugin.app.vault.getFiles().forEach((file) => {
|
||||
this.plugin.fmtpHandler?.handleRename({ id: '', result: false, path: file.path }, false);
|
||||
});
|
||||
this.display();
|
||||
})
|
||||
);
|
||||
|
||||
|
|
@ -441,7 +443,6 @@ export class SettingsTab extends PluginSettingTab {
|
|||
} else {
|
||||
this.plugin.updateBreadcrumbs(true);
|
||||
}
|
||||
this.display();
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue