Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
lelemm and coderabbitai[bot] authored Nov 12, 2024
1 parent ce74088 commit 68bca8c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/desktop-client/src/components/reports/reports/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,13 @@ function SummaryInner({ widget }: SummaryInnerProps) {

const onSaveWidgetName = async (newName: string) => {
if (!widget) {
throw new Error('No widget that could be saved.');
dispatch(
addNotification({
type: 'error',
message: t('Cannot save: No widget available.'),
}),
);
return;
}

const name = newName || t('Summary');
Expand All @@ -189,7 +195,13 @@ function SummaryInner({ widget }: SummaryInnerProps) {

async function onSaveWidget() {
if (!widget) {
throw new Error('No widget that could be saved.');
dispatch(
addNotification({
type: 'error',
message: t('Cannot save: No widget available.'),
}),
);
return;
}

await send('dashboard-update-widget', {
Expand Down

0 comments on commit 68bca8c

Please sign in to comment.