@@ -5,7 +5,6 @@ import { toggleFullscreen } from "/src/stores/fullscreen";
55import type { PortfolioStore } from "/src/stores/portfolio" ;
66import { pasteFile } from "/src/utility-functions/files" ;
77import { makeKeyboardModifiersBitfield , textInputCleanup , getLocalizedScanCode } from "/src/utility-functions/keyboard-entry" ;
8- import { savedStatus } from "/src/utility-functions/persistence" ;
98import { operatingSystem } from "/src/utility-functions/platform" ;
109import type { EditorWrapper } from "/wrapper/pkg/graphite_wasm_wrapper" ;
1110
@@ -248,15 +247,15 @@ export function onModifyInputField(e: CustomEvent) {
248247
249248export async function onBeforeUnload ( e : BeforeUnloadEvent , editor : EditorWrapper , portfolioStore : PortfolioStore ) {
250249 const activeDocument = get ( portfolioStore ) . documents [ get ( portfolioStore ) . activeDocumentIndex ] ;
251- if ( activeDocument && ! savedStatus ( activeDocument . details ) . isAutoSaved ) editor . triggerAutoSave ( activeDocument . id ) ;
250+ if ( activeDocument && ! activeDocument . details . is_auto_saved ) editor . triggerAutoSave ( activeDocument . id ) ;
252251
253252 // Skip the message if the editor crashed, since work is already lost
254253 if ( await editor . hasCrashed ( ) ) return ;
255254
256255 // Skip the message during development, since it's annoying when testing
257256 if ( await editor . inDevelopmentMode ( ) ) return ;
258257
259- const allDocumentsSaved = get ( portfolioStore ) . documents . reduce ( ( acc , doc ) => acc && savedStatus ( doc . details ) . isSaved , true ) ;
258+ const allDocumentsSaved = get ( portfolioStore ) . documents . reduce ( ( acc , doc ) => acc && doc . details . is_saved , true ) ;
260259 if ( ! allDocumentsSaved ) {
261260 e . returnValue = "Unsaved work will be lost if the web browser tab is closed. Close anyway?" ;
262261 e . preventDefault ( ) ;
0 commit comments