diff --git a/src/renderer/src/store/tree.ts b/src/renderer/src/store/tree.ts index d854d5f8..1091b4b8 100644 --- a/src/renderer/src/store/tree.ts +++ b/src/renderer/src/store/tree.ts @@ -319,8 +319,7 @@ export class TreeStore { if (!treeStore.currentTab.current || this.tabs.length === 1) { const first = this.firstNote if (first) { - this.currentTab.history.push(first) - this.currentTab.index = 0 + this.openNote(first) this.openParentDir(first.filePath) } } @@ -469,6 +468,9 @@ export class TreeStore { selection.removeAllRanges() selection.addRange(backRange) } + if (this.openedNote) { + document.title = this.root ? `${basename(this.root.filePath)}-${basename(this.openedNote.filePath)}` : basename(this.openedNote.filePath) + } }) this.recordTabs() }