mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 11:18:13 +08:00
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:
@@ -66,6 +66,7 @@ export function createPortfolioStore(subscriptions: SubscriptionsRouter, editor:
|
|||||||
subscriptions.subscribeFrontendMessage("UpdateOpenDocumentsList", (data) => {
|
subscriptions.subscribeFrontendMessage("UpdateOpenDocumentsList", (data) => {
|
||||||
update((state) => {
|
update((state) => {
|
||||||
state.documents = data.openDocuments;
|
state.documents = data.openDocuments;
|
||||||
|
if (state.documents.length === 0) state.activeDocumentIndex = 0;
|
||||||
return state;
|
return state;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user