diff --git a/src/core/main/custom/toolbar.ts b/src/core/main/custom/toolbar.ts index a289aad..f28444c 100644 --- a/src/core/main/custom/toolbar.ts +++ b/src/core/main/custom/toolbar.ts @@ -376,7 +376,7 @@ CustomToolbar.register( } ); -window.addEventListener('unload', () => { +window.addEventListener('beforeunload', () => { CustomToolbar.save(); }); window.addEventListener('blur', () => { diff --git a/src/core/main/storage.ts b/src/core/main/storage.ts index ba7270c..2f56fbc 100644 --- a/src/core/main/storage.ts +++ b/src/core/main/storage.ts @@ -98,7 +98,7 @@ export class GameStorage { } } -window.addEventListener('unload', () => { +window.addEventListener('beforeunload', () => { GameStorage.list.forEach(v => v.write()); }); window.addEventListener('blur', () => {