mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-24 18:38:40 +01:00
use beforeunload :3
This commit is contained in:
parent
e5a6092a25
commit
1af6240596
1 changed files with 2 additions and 4 deletions
|
@ -183,10 +183,8 @@ function resumeProgress() {
|
|||
}
|
||||
}
|
||||
|
||||
video.addEventListener('timeupdate', () => {
|
||||
if (Math.floor(video.currentTime) % 5 === 0) {
|
||||
saveProgress();
|
||||
}
|
||||
window.addEventListener('beforeunload', () => {
|
||||
saveProgress();
|
||||
});
|
||||
|
||||
video.addEventListener('ended', () => {
|
||||
|
|
Loading…
Reference in a new issue