Skip to content

Commit ede1130

Browse files
committed
fix(menu): fix menubar items doesn't rendered
resolve #2113
1 parent b74c1a0 commit ede1130

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/menu.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export const mainMenuTemplate = async (
236236
}
237237
]
238238
: []),
239-
...config.get('options.themes')?.map((theme: string) => ({
239+
...(config.get('options.themes')?.map((theme: string) => ({
240240
type: 'normal' as const,
241241
label: theme,
242242
async click() {
@@ -257,11 +257,11 @@ export const mainMenuTemplate = async (
257257
});
258258

259259
if (response === 1) {
260-
config.set('options.themes', config.get('options.themes')?.filter((t) => t !== theme));
260+
config.set('options.themes', config.get('options.themes')?.filter((t) => t !== theme) ?? []);
261261
innerRefreshMenu();
262262
}
263263
}
264-
})),
264+
})) ?? []),
265265
{ type: 'separator' },
266266
{
267267
label: t(

0 commit comments

Comments
 (0)