diff --git a/packages/desktop-client/src/components/reports/reports/Summary.tsx b/packages/desktop-client/src/components/reports/reports/Summary.tsx index 029de2529f1..7e8b9722e4e 100644 --- a/packages/desktop-client/src/components/reports/reports/Summary.tsx +++ b/packages/desktop-client/src/components/reports/reports/Summary.tsx @@ -169,7 +169,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'); @@ -191,7 +197,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', {