Skip to content

Commit

Permalink
fix: Selecting a tab to change the window name is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
1943time committed Nov 4, 2023
1 parent 707cf29 commit b1e671f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/renderer/src/store/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit b1e671f

Please sign in to comment.