didn't realize transaction needed readwrite

This commit is contained in:
Pagwin 2025-09-03 16:37:30 -04:00
parent 20ea7787dc
commit d9541fb2b0

View file

@ -31,7 +31,7 @@ async function handle_redirect(req){
const suc_promise = new Promise((res)=>{
db_req.onsuccess = (event) => {
const db = event.target.result;
const transaction = db.transaction("light-dark-store");
const transaction = db.transaction("light-dark-store", "readwrite");
transaction.oncomplete = res;
transaction.objectStore("light-dark-store", "readwrite");
@ -89,7 +89,7 @@ async function handle_html(req, resp, body){
const transaction = db.transaction("light-dark-store");
transaction.oncomplete = res;
const obj_store = transaction.objectStore("light-dark-store", "read");
const obj_store = transaction.objectStore("light-dark-store", "readonly");
const grab = obj_store.get(1);
grab.onsuccess = (event) => {res(!!event.result)};
};