From ede11307efbb37f95e430b804f580d5c54f4957b Mon Sep 17 00:00:00 2001 From: Su-Yong Date: Fri, 7 Jun 2024 21:16:48 +0900 Subject: [PATCH] fix(menu): fix menubar items doesn't rendered resolve #2113 --- src/menu.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/menu.ts b/src/menu.ts index 700d83ce..22bde9af 100644 --- a/src/menu.ts +++ b/src/menu.ts @@ -236,7 +236,7 @@ export const mainMenuTemplate = async ( } ] : []), - ...config.get('options.themes')?.map((theme: string) => ({ + ...(config.get('options.themes')?.map((theme: string) => ({ type: 'normal' as const, label: theme, async click() { @@ -257,11 +257,11 @@ export const mainMenuTemplate = async ( }); if (response === 1) { - config.set('options.themes', config.get('options.themes')?.filter((t) => t !== theme)); + config.set('options.themes', config.get('options.themes')?.filter((t) => t !== theme) ?? []); innerRefreshMenu(); } } - })), + })) ?? []), { type: 'separator' }, { label: t(