Files
akartonplanning/app/config/store.js
Daan Selen 475dc8a9da
All checks were successful
Build/release / action-release (push) Successful in 3m13s
refac: prohibit downloads and disable GPU acceleration
2025-09-30 14:34:43 +02:00

43 lines
1.1 KiB
JavaScript

import useragents from "../useragents.json" with { type: "json" };
import Store from "electron-store";
const store = new Store();
export function getValue(key) {
return store.get(key);
}
export function setValue(key, value) {
store.set(key, value);
}
export function getValueOrDefault(key, defaultValue) {
const value = store.get(key);
if (value === undefined) {
try {
console.log(key)
store.set(key, defaultValue);
return defaultValue;
} catch (e) {
console.log(e)
}
}
return value;
}
getValueOrDefault("enterprise-or-normal", "?auth=2");
getValueOrDefault("websites-in-new-window", "false");
getValueOrDefault("autohide-menubar", "true");
getValueOrDefault("useragentstring", useragents.WindowsChrome);
getValueOrDefault("blockadsandtrackers", "false");
getValueOrDefault("dynamicicons", "true");
getValueOrDefault("autoupdate", "false");
getValueOrDefault("custompage", "home");
getValueOrDefault("windowWidth", 0.71);
getValueOrDefault("windowHeight", 0.74);
getValueOrDefault("customWindowSize", false);
getValueOrDefault("externalLinks", "false");
setValue("enterprise-or-normal", "?auth=2");