Fix the Fix > Close All action not resulting in the welcome screen being shown (#4107)

Fix missing welcome panel after closing all documents

Closing all documents left the Welcome panel as the only tab, but the old active document index could still point to a tab that no longer existed. The fix is to reset it to 0 when the document list becomes empty.
This commit is contained in:
Timon 2026-05-06 12:03:14 +00:00 committed by GitHub
parent 023cf1bedd
commit 8ae8c47fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -66,6 +66,7 @@ export function createPortfolioStore(subscriptions: SubscriptionsRouter, editor:
subscriptions.subscribeFrontendMessage("UpdateOpenDocumentsList", (data) => {
update((state) => {
state.documents = data.openDocuments;
if (state.documents.length === 0) state.activeDocumentIndex = 0;
return state;
});
});