From cb5c9c2191b845ae11c9ff74b2754a5b32205a60 Mon Sep 17 00:00:00 2001 From: Pagwin Date: Wed, 3 Sep 2025 17:30:05 -0400 Subject: [PATCH] e --- static/demos/light-dark-demo-4/sw.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/demos/light-dark-demo-4/sw.js b/static/demos/light-dark-demo-4/sw.js index 66945c2..68fab4a 100644 --- a/static/demos/light-dark-demo-4/sw.js +++ b/static/demos/light-dark-demo-4/sw.js @@ -63,15 +63,18 @@ function toggleLightDark(transaction){ return new Promise((res)=>{ const obj_store = transaction.objectStore("light-dark-store"); const grab = obj_store.get(1); + grab.onerror = ()=>{console.error("grab error");res();}; grab.onsuccess = (event)=>{ const val = event.result; if(val){ const yeet = obj_store.delete(1); yeet.onsuccess = res; + yeet.onerror = ()=>{console.error("yeet error");res();}; } else { const plonk = obj_store.add({id:1}, 1); plonk.onsuccess = res; + plonk.onerror = ()=>{console.error("plonk error");res();}; } } });