From 0d2cc5a3543439605002fea2d0b9affedc288813 Mon Sep 17 00:00:00 2001 From: Pagwin Date: Tue, 2 Sep 2025 23:25:28 -0400 Subject: [PATCH] oops async --- static/demos/light-dark-demo-4/sw.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/demos/light-dark-demo-4/sw.js b/static/demos/light-dark-demo-4/sw.js index 4ed3097..d4f06bc 100644 --- a/static/demos/light-dark-demo-4/sw.js +++ b/static/demos/light-dark-demo-4/sw.js @@ -34,8 +34,9 @@ async function handle_redirect(req){ transaction.oncomplete = res; transaction.objectStore("light-dark-store", "readwrite"); - toggleLightDark(transaction); - transaction.commit(); + toggleLightDark(transaction) + .then(transaction.commit.bind(transaction)) + .then(res); }; }); await Promise.all([up_promise, suc_promise]);