mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 20:59:37 +08:00
fix: 使用beforeunload事件
This commit is contained in:
parent
ac5603f2f5
commit
6c8104e39e
@ -376,7 +376,7 @@ CustomToolbar.register(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
window.addEventListener('unload', () => {
|
window.addEventListener('beforeunload', () => {
|
||||||
CustomToolbar.save();
|
CustomToolbar.save();
|
||||||
});
|
});
|
||||||
window.addEventListener('blur', () => {
|
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());
|
GameStorage.list.forEach(v => v.write());
|
||||||
});
|
});
|
||||||
window.addEventListener('blur', () => {
|
window.addEventListener('blur', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user