We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b74c1a0 commit ede1130Copy full SHA for ede1130
src/menu.ts
@@ -236,7 +236,7 @@ export const mainMenuTemplate = async (
236
}
237
]
238
: []),
239
- ...config.get('options.themes')?.map((theme: string) => ({
+ ...(config.get('options.themes')?.map((theme: string) => ({
240
type: 'normal' as const,
241
label: theme,
242
async click() {
@@ -257,11 +257,11 @@ export const mainMenuTemplate = async (
257
});
258
259
if (response === 1) {
260
- config.set('options.themes', config.get('options.themes')?.filter((t) => t !== theme));
+ config.set('options.themes', config.get('options.themes')?.filter((t) => t !== theme) ?? []);
261
innerRefreshMenu();
262
263
264
- })),
+ })) ?? []),
265
{ type: 'separator' },
266
{
267
label: t(
0 commit comments