mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-12 08:44:30 +08:00
fix: 使用beforeunload事件
This commit is contained in:
1 parent
ac5603f2f5
commit
6c8104e39e
2 files changed
+2
-2
No files matched your search
@@ -376,7 +376,7 @@ CustomToolbar.register(
|
||||
}
|
||||
);
|
||||
|
||||
window.addEventListener('unload', () => {
|
||||
window.addEventListener('beforeunload', () => {
|
||||
CustomToolbar.save();
|
||||
});
|
||||
window.addEventListener('blur', () => {
|
||||
|
||||
@@ -98,7 +98,7 @@ export class GameStorage<T extends object = any> {
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('unload', () => {
|
||||
window.addEventListener('beforeunload', () => {
|
||||
GameStorage.list.forEach(v => v.write());
|
||||
});
|
||||
window.addEventListener('blur', () => {
|
||||
|
||||
Reference in new issue
Block a user