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:
parent
023cf1bedd
commit
8ae8c47fe1
|
|
@ -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;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue