From 667768c4332bc39d466112d7b11cc9622c115692 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Mon, 24 Aug 2026 14:47:48 +0200 Subject: [PATCH] fix lint --- src/main/utils/mergeDefaults.ts | 2 +- src/main/utils/popout.ts | 2 +- src/renderer/components/settings/Settings.tsx | 6 +++--- src/renderer/patches/platformClass.tsx | 2 -- src/renderer/patches/windowsTitleBar.tsx | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/utils/mergeDefaults.ts b/src/main/utils/mergeDefaults.ts index 494d809..58f52b6 100644 --- a/src/main/utils/mergeDefaults.ts +++ b/src/main/utils/mergeDefaults.ts @@ -13,7 +13,7 @@ export function mergeDefaults(obj: T, defaults: T): T { for (const key in defaults) { const v = defaults[key]; - if (typeof v === "object" && !Array.isArray(v)) { + if (typeof v === "object" && !Array.isArray(v) && v !== null) { obj[key] ??= {} as any; mergeDefaults(obj[key], v); } else { diff --git a/src/main/utils/popout.ts b/src/main/utils/popout.ts index dd26896..fc81466 100644 --- a/src/main/utils/popout.ts +++ b/src/main/utils/popout.ts @@ -37,7 +37,7 @@ const DEFAULT_POPOUT_OPTIONS: BrowserWindowConstructorOptions = { backgroundColor: "#2f3136", minWidth: MIN_POPOUT_WIDTH, minHeight: MIN_POPOUT_HEIGHT, - frame: Settings.store.customTitleBar !== true, + frame: Settings.store.nativeTitleBar, titleBarStyle: process.platform === "darwin" ? "hidden" : undefined, trafficLightPosition: process.platform === "darwin" diff --git a/src/renderer/components/settings/Settings.tsx b/src/renderer/components/settings/Settings.tsx index d04b179..207ce3e 100644 --- a/src/renderer/components/settings/Settings.tsx +++ b/src/renderer/components/settings/Settings.tsx @@ -66,19 +66,19 @@ const SettingsOptions: Record> key: "enableMenu", title: "Enable Menu Bar", description: "Enables the application menu bar. Press ALT to toggle visibility.", - disabled: () => Settings.store.nativeTitleBar !== true + disabled: () => !Settings.store.nativeTitleBar }, { key: "enableShadow", title: "Enable Window Shadow", description: "Enables the window shadow. Requires a full restart.", - disabled: () => Settings.store.nativeTitleBar === true + disabled: () => Settings.store.nativeTitleBar }, { key: "enableRoundedCorners", title: "Enable Rounded Corners", description: "Enables rounded corners. Requires a full restart.", - disabled: () => Settings.store.nativeTitleBar === true + disabled: () => Settings.store.nativeTitleBar }, { key: "enableSplashScreen", diff --git a/src/renderer/patches/platformClass.tsx b/src/renderer/patches/platformClass.tsx index 3fdbd22..f76384e 100644 --- a/src/renderer/patches/platformClass.tsx +++ b/src/renderer/patches/platformClass.tsx @@ -4,7 +4,6 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { Settings } from "renderer/settings"; import { isMac } from "renderer/utils"; import { addPatch } from "./shared"; @@ -21,7 +20,6 @@ addPatch({ ], getPlatformClass() { - if (Settings.store.customTitleBar) return "platform-win"; if (isMac) return "platform-osx"; return "platform-web"; } diff --git a/src/renderer/patches/windowsTitleBar.tsx b/src/renderer/patches/windowsTitleBar.tsx index 9ddba6b..505ca91 100644 --- a/src/renderer/patches/windowsTitleBar.tsx +++ b/src/renderer/patches/windowsTitleBar.tsx @@ -8,7 +8,7 @@ import { Settings } from "renderer/settings"; import { addPatch } from "./shared"; -if (Settings.store.customTitleBar) +if (!Settings.store.nativeTitleBar) addPatch({ patches: [ {