From 1af624059625c74f6ccb5b49b17db524619b0500 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Sun, 21 Apr 2024 03:16:07 +0000 Subject: [PATCH] use beforeunload :3 --- css/app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/css/app.js b/css/app.js index 67b19cfd..a51efc90 100644 --- a/css/app.js +++ b/css/app.js @@ -183,10 +183,8 @@ function resumeProgress() { } } -video.addEventListener('timeupdate', () => { - if (Math.floor(video.currentTime) % 5 === 0) { - saveProgress(); - } +window.addEventListener('beforeunload', () => { + saveProgress(); }); video.addEventListener('ended', () => {