2024-07-22 13:21:44 +05:30
|
|
|
import useragents from "../useragents.json" with { type: "json" };
|
2024-05-07 15:43:33 +05:30
|
|
|
import Store from "electron-store";
|
2024-07-21 16:53:30 +05:30
|
|
|
|
2023-06-05 20:12:06 +05:30
|
|
|
const store = new Store();
|
|
|
|
|
|
2024-05-07 15:43:33 +05:30
|
|
|
export function getValue(key) {
|
2023-06-11 21:15:36 +05:30
|
|
|
return store.get(key);
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-07 15:43:33 +05:30
|
|
|
export function setValue(key, value) {
|
2023-06-11 21:15:36 +05:30
|
|
|
store.set(key, value);
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-07 15:43:33 +05:30
|
|
|
export function getValueOrDefault(key, defaultValue) {
|
2023-06-11 21:15:36 +05:30
|
|
|
const value = store.get(key);
|
|
|
|
|
if (value === undefined) {
|
|
|
|
|
store.set(key, defaultValue);
|
|
|
|
|
return defaultValue;
|
|
|
|
|
}
|
|
|
|
|
return value;
|
|
|
|
|
}
|
2024-07-21 16:53:30 +05:30
|
|
|
|
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");
|
2024-07-21 16:53:30 +05:30
|
|
|
getValueOrDefault("useragentstring", useragents.Windows);
|
|
|
|
|
getValueOrDefault("discordrpcstatus", "false");
|
|
|
|
|
getValueOrDefault("blockadsandtrackers", "false");
|
|
|
|
|
getValueOrDefault("dynamicicons", "true");
|
|
|
|
|
getValueOrDefault("autoupdater", "true");
|
|
|
|
|
getValueOrDefault("custompage", "home");
|
2024-07-22 12:13:59 +05:30
|
|
|
getValueOrDefault("windowWidth", 0.71);
|
|
|
|
|
getValueOrDefault("windowHeight", 0.74);
|
|
|
|
|
getValueOrDefault("customWindowSize", false);
|
2025-09-26 15:32:06 +02:00
|
|
|
getValueOrDefault("externalLinks", "false");
|
2024-07-21 16:53:30 +05:30
|
|
|
|
|
|
|
|
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") {
|
2024-07-21 16:53:30 +05:30
|
|
|
setValue("enterprise-or-normal", "?auth=2");
|
|
|
|
|
}
|