Skip to content

Commit

Permalink
fix: tabs not being restored correctly
Browse files Browse the repository at this point in the history
fixes #936
  • Loading branch information
outercloudstudio committed Sep 23, 2023
1 parent 746f746 commit 05def2f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/TabSystem/OpenedFiles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Signal } from '/@/components/Common/Event/Signal'
import { settingsState } from '/@/components/Windows/Settings/SettingsState'
import { App } from '/@/App'
import { PersistentQueue } from '/@/components/Common/PersistentQueue'
Expand All @@ -13,11 +12,11 @@ export class OpenedFiles extends PersistentQueue<string> {
if (settingsState?.general?.restoreTabs ?? true) {
await this.fired

for (let i = this.queue.elements.length - 1; i >= 0; i--) {
for (const file of this.queue.elements.reverse()) {
try {
// Try to restore tab
await this.tabSystem.openPath(this.queue.elements[i], {
selectTab: i === 0,
await this.tabSystem.openPath(file, {
selectTab: file == this.queue.elements[0],
isTemporary: false,
})
} catch {}
Expand Down

0 comments on commit 05def2f

Please sign in to comment.