fix darkmode with color picker

This commit is contained in:
SethBurkart123
2023-10-20 06:48:02 +11:00
parent e0b4a29635
commit b1c9beb3d9
3 changed files with 7 additions and 33 deletions
-31
View File
@@ -1,31 +0,0 @@
export const openDB = async () => {
const request = indexedDB.open("MyDatabase", 1);
request.onupgradeneeded = async (event) => {
const db = event.target.result;
await db.createObjectStore("backgrounds", { keyPath: "id" });
};
return request;
};
export const writeData = async (type, data) => {
console.log("Reading Data");
const db = await openDB();
console.log("Opened DB");
const tx = db.transaction("backgrounds", "readwrite");
const store = tx.objectStore("backgrounds");
const request = await store.put({ id: "customBackground", type, data });
console.log("Data written successfully");
return request.result;
};
export const readData = async () => {
const db = await openDB();
const tx = db.transaction("backgrounds", "readonly");
const store = tx.objectStore("backgrounds");
return store.get("customBackground");
};
+1
View File
@@ -32,6 +32,7 @@ export default class StorageListener {
if (changes.DarkMode) {
this.darkMode = changes.DarkMode.newValue;
console.log(this.darkMode);
}
if (changes?.customshortcuts?.newValue) {