Clean up autosave persistence (#3115)

* Set auto save state to false on document rename

* Update open document list on transaction commit and aboard

* Use current network to compute hash

Was using the last element in undo
Before artworks where not auto saved when the had no undo history

* Refactor persistence
This commit is contained in:
Timon
2025-09-02 13:27:38 +00:00
committed by GitHub
parent b5ebe78f5e
commit 083dfa5f49
9 changed files with 93 additions and 83 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
import { writable } from "svelte/store";
import { type Editor } from "@graphite/editor";
import type { OpenDocument } from "@graphite/messages";
import {
type FrontendDocumentDetails,
TriggerFetchAndOpenDocument,
TriggerSaveDocument,
TriggerExportImage,
@@ -21,7 +21,7 @@ import { extractPixelData, rasterizeSVG } from "@graphite/utility-functions/rast
export function createPortfolioState(editor: Editor) {
const { subscribe, update } = writable({
unsaved: false,
documents: [] as FrontendDocumentDetails[],
documents: [] as OpenDocument[],
activeDocumentIndex: 0,
dataPanelOpen: false,
propertiesPanelOpen: true,