mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 05:57:58 +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', () => {
|
window.addEventListener('beforeunload', () => {
|
||||||
if (Math.floor(video.currentTime) % 5 === 0) {
|
saveProgress();
|
||||||
saveProgress();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
video.addEventListener('ended', () => {
|
video.addEventListener('ended', () => {
|
||||||
|
|
Loading…
Reference in a new issue