also allow using discord titlebar on non-windows

This commit is contained in:
Vendicated
2024-01-16 01:08:06 +01:00
parent 2aa0b0fa20
commit 2e4c834a90
6 changed files with 22 additions and 13 deletions

View File

@@ -35,9 +35,15 @@ function loadSettings<T extends object = any>(file: string, name: string) {
}
export const Settings = loadSettings<TSettings>(SETTINGS_FILE, "Vesktop settings");
if (Object.hasOwn(Settings.plain, "discordWindowsTitleBar")) {
Settings.plain.customTitleBar = Settings.plain.discordWindowsTitleBar;
delete Settings.plain.discordWindowsTitleBar;
Settings.markAsChanged();
}
export const VencordSettings = loadSettings<any>(VENCORD_SETTINGS_FILE, "Vencord settings");
if (Object.hasOwn(Settings.store, "firstLaunch") && !existsSync(STATE_FILE)) {
if (Object.hasOwn(Settings.plain, "firstLaunch") && !existsSync(STATE_FILE)) {
console.warn("legacy state in settings.json detected. migrating to state.json");
const state = {} as TState;
for (const prop of [
@@ -47,7 +53,7 @@ if (Object.hasOwn(Settings.store, "firstLaunch") && !existsSync(STATE_FILE)) {
"skippedUpdate",
"steamOSLayoutVersion",
"windowBounds"
]) {
] as const) {
state[prop] = Settings.plain[prop];
delete Settings.plain[prop];
}