This commit is contained in:
Pagwin 2025-09-04 15:37:49 -04:00
parent ea5cf5f3c6
commit 7558adc2d1

View file

@ -60,6 +60,15 @@ function IDB_cond_create(db, objectStoreName, opts={}){
}); });
} }
function toggleLightDark(transaction){ function toggleLightDark(transaction){
// Add this temporarily to see all keys/values
const cursor = obj_store.openCursor();
cursor.onsuccess = (event) => {
const cursor = event.target.result;
if (cursor) {
console.log("Key:", cursor.key, "Value:", cursor.value);
cursor.continue();
}
};
return new Promise((res)=>{ return new Promise((res)=>{
const obj_store = transaction.objectStore("light-dark-store"); const obj_store = transaction.objectStore("light-dark-store");
const grab = obj_store.get(1); const grab = obj_store.get(1);
@ -73,7 +82,7 @@ function toggleLightDark(transaction){
yeet.onerror = (e)=>{console.error("yeet error",e );res();}; yeet.onerror = (e)=>{console.error("yeet error",e );res();};
} }
else { else {
const plonk = obj_store.put({id:1}, 1); const plonk = obj_store.put(true, 1);
plonk.onsuccess = res; plonk.onsuccess = res;
plonk.onerror = (e)=>{console.error("plonk error", e);res();}; plonk.onerror = (e)=>{console.error("plonk error", e);res();};
} }