Skip to content

Commit ed5c08a

Browse files
committed
dont swallow up errors
1 parent 7b5aeab commit ed5c08a

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

  • frontend/src/ts/components/pages/settings/custom-setting

frontend/src/ts/components/pages/settings/custom-setting/Theme.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,17 +376,28 @@ function CustomThemeButton(props: { theme: CustomTheme }): JSXElement {
376376
message: "Name is required",
377377
};
378378
}
379-
void editCustomTheme({
379+
editCustomTheme({
380380
themeId: props.theme._id,
381381
name: name.replace(/ /g, "_"),
382382
colors: updateColors
383383
? convertThemeToCustomColors(untrack(() => getTheme()))
384384
: untrack(() => props.theme.colors),
385-
});
385+
})
386+
.then(() => {
387+
showSuccessNotification("Updated");
388+
})
389+
.catch(() => {
390+
showErrorNotification(
391+
e instanceof Error
392+
? e.message
393+
: "Failed to update custom theme",
394+
);
395+
});
386396

387397
return {
388398
status: "success",
389-
message: "Updated",
399+
message: "",
400+
showNotification: false,
390401
};
391402
},
392403
});

0 commit comments

Comments
 (0)