diff --git a/packages/desktop-client/src/components/reports/reports/Summary.tsx b/packages/desktop-client/src/components/reports/reports/Summary.tsx index 161d2a2816b..92afc97a303 100644 --- a/packages/desktop-client/src/components/reports/reports/Summary.tsx +++ b/packages/desktop-client/src/components/reports/reports/Summary.tsx @@ -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'); @@ -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', {