Rename UI_MODE to THEME

This commit is contained in:
binwiederhier 2023-06-28 13:30:51 -04:00
parent e9f170a197
commit 64ac111d55
5 changed files with 40 additions and 36 deletions

View file

@ -1,6 +1,6 @@
import db from "./db";
export const UI_MODE = {
export const THEME = {
DARK: "dark",
LIGHT: "light",
SYSTEM: "system",
@ -47,13 +47,13 @@ class Prefs {
await this.db.prefs.put({ key: "webPushEnabled", value: enabled });
}
async uiMode() {
const uiMode = await this.db.prefs.get("uiMode");
return uiMode?.value ?? UI_MODE.SYSTEM;
async theme() {
const theme = await this.db.prefs.get("theme");
return theme?.value ?? THEME.SYSTEM;
}
async setUIMode(mode) {
await this.db.prefs.put({ key: "uiMode", value: mode });
async setTheme(mode) {
await this.db.prefs.put({ key: "theme", value: mode });
}
}