From 6df7a45d6165c97403e96401754182f971ee9b75 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Sat, 11 Jan 2025 23:20:44 +1100 Subject: [PATCH] Fix desktop API called when frontend settings loaded --- src/extensions/core/electronAdapter.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/extensions/core/electronAdapter.ts b/src/extensions/core/electronAdapter.ts index 941982c44..678c4dc5a 100644 --- a/src/extensions/core/electronAdapter.ts +++ b/src/extensions/core/electronAdapter.ts @@ -39,14 +39,16 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil' id: 'Comfy-Desktop.WindowStyle', category: ['Comfy-Desktop', 'General', 'Window Style'], name: 'Window Style', - tooltip: 'Choose custom option to hide the system title bar', + tooltip: "Custom: Replace the system title bar with ComfyUI's Top menu", type: 'combo', defaultValue: 'default', options: ['default', 'custom'], onChange: ( newValue: 'default' | 'custom', - oldValue: 'default' | 'custom' + oldValue?: 'default' | 'custom' ) => { + if (!oldValue) return + electronAPI.Config.setWindowStyle(newValue) onChangeRestartApp(newValue, oldValue)