From 0d68851cf4fb76d952d15fbf18abe8520133a204 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Wed, 30 Oct 2024 17:46:52 -0300 Subject: [PATCH] fix: ensure both values are passed to object to prevent false outcome --- src/renderer/src/declaration.d.ts | 4 ++-- src/renderer/src/pages/settings/settings-behavior.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/declaration.d.ts b/src/renderer/src/declaration.d.ts index e9d57529..a12862b3 100644 --- a/src/renderer/src/declaration.d.ts +++ b/src/renderer/src/declaration.d.ts @@ -115,8 +115,8 @@ declare global { preferences: Partial ) => Promise; autoLaunch: (autoLaunchProps: { - enabled?: boolean; - minimized?: boolean; + enabled: boolean; + minimized: boolean; }) => Promise; authenticateRealDebrid: (apiToken: string) => Promise; diff --git a/src/renderer/src/pages/settings/settings-behavior.tsx b/src/renderer/src/pages/settings/settings-behavior.tsx index d2794c36..4e3ef2f3 100644 --- a/src/renderer/src/pages/settings/settings-behavior.tsx +++ b/src/renderer/src/pages/settings/settings-behavior.tsx @@ -60,7 +60,10 @@ export function SettingsBehavior() { label={t("launch_with_system")} onChange={() => { handleChange({ runAtStartup: !form.runAtStartup }); - window.electron.autoLaunch({ enabled: !form.runAtStartup }); + window.electron.autoLaunch({ + enabled: !form.runAtStartup, + minimized: form.startMinimized, + }); }} checked={form.runAtStartup} /> @@ -75,7 +78,10 @@ export function SettingsBehavior() { disabled={!form.runAtStartup} onChange={() => { handleChange({ startMinimized: !form.startMinimized }); - window.electron.autoLaunch({ minimized: !form.startMinimized }); + window.electron.autoLaunch({ + minimized: !form.startMinimized, + enabled: form.runAtStartup, + }); }} />