Files
akartonplanning/app/config/store.js

42 lines
1.3 KiB
JavaScript
Raw Normal View History

import useragents from "../useragents.json" with { type: "json" };
2024-05-07 15:43:33 +05:30
import Store from "electron-store";
const store = new Store();
2024-05-07 15:43:33 +05:30
export function getValue(key) {
return store.get(key);
}
2024-05-07 15:43:33 +05:30
export function setValue(key, value) {
store.set(key, value);
}
2024-05-07 15:43:33 +05:30
export function getValueOrDefault(key, defaultValue) {
const value = store.get(key);
if (value === undefined) {
store.set(key, defaultValue);
return defaultValue;
}
return value;
}
2025-09-26 15:56:25 +02:00
//getValueOrDefault("enterprise-or-normal", "?auth=2");
2025-09-26 15:32:06 +02:00
getValueOrDefault("websites-in-new-window", "false");
getValueOrDefault("autohide-menubar", "true");
getValueOrDefault("useragentstring", useragents.Windows);
getValueOrDefault("discordrpcstatus", "false");
getValueOrDefault("blockadsandtrackers", "false");
getValueOrDefault("dynamicicons", "true");
getValueOrDefault("autoupdater", "true");
getValueOrDefault("custompage", "home");
getValueOrDefault("windowWidth", 0.71);
getValueOrDefault("windowHeight", 0.74);
getValueOrDefault("customWindowSize", false);
2025-09-26 15:32:06 +02:00
getValueOrDefault("externalLinks", "false");
if (getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=1") {
setValue("enterprise-or-normal", "?auth=1");
2024-07-21 17:04:59 +05:30
} else if (getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=2") {
setValue("enterprise-or-normal", "?auth=2");
}