diff --git a/packages/desktop-client/src/components/manager/DeleteFile.tsx b/packages/desktop-client/src/components/manager/DeleteFile.tsx index c8dff180cbd..29c3875b80b 100644 --- a/packages/desktop-client/src/components/manager/DeleteFile.tsx +++ b/packages/desktop-client/src/components/manager/DeleteFile.tsx @@ -26,17 +26,6 @@ export function DeleteFile({ modalProps, actions, file }: DeleteFileProps) { null, ); - async function onDelete() { - setLoadingState(isCloudFile ? 'cloud' : 'local'); - await actions.deleteBudget( - 'id' in file ? file.id : undefined, - isCloudFile ? file.cloudFileId : undefined, - ); - setLoadingState(null); - - modalProps.onBack(); - } - return ( { + setLoadingState('cloud'); + await actions.deleteBudget( + 'id' in file ? file.id : undefined, + file.cloudFileId, + ); + setLoadingState(null); + + modalProps.onBack(); + }} > Delete file from all devices @@ -125,7 +123,13 @@ export function DeleteFile({ modalProps, actions, file }: DeleteFileProps) { backgroundColor: theme.errorText, }), }} - onClick={onDelete} + onClick={async () => { + setLoadingState('local'); + await actions.deleteBudget(file.id); + setLoadingState(null); + + modalProps.onBack(); + }} > Delete file locally diff --git a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx index ca7f71188d9..4d380951f1d 100644 --- a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx +++ b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTable.tsx @@ -50,10 +50,9 @@ export function ReportTable({ }); const renderItem = useCallback( - ({ item, groupByItem, mode, style, key, monthsCount }) => { + ({ item, groupByItem, mode, style, monthsCount }) => { return ( 100000 && - amountToCurrency(item[balanceTypeOp]) + Math.abs(item[balanceTypeOp]) > 100000 + ? amountToCurrency(item[balanceTypeOp]) + : undefined } width="flex" privacyFilter @@ -108,8 +109,9 @@ export function ReportTableTotals({ }} value={amountToCurrency(data.totalAssets)} title={ - Math.abs(data.totalAssets) > 100000 && - amountToCurrency(data.totalAssets) + Math.abs(data.totalAssets) > 100000 + ? amountToCurrency(data.totalAssets) + : undefined } width="flex" privacyFilter @@ -121,8 +123,9 @@ export function ReportTableTotals({ }} value={amountToCurrency(data.totalDebts)} title={ - Math.abs(data.totalDebts) > 100000 && - amountToCurrency(data.totalDebts) + Math.abs(data.totalDebts) > 100000 + ? amountToCurrency(data.totalDebts) + : undefined } width="flex" privacyFilter @@ -136,8 +139,9 @@ export function ReportTableTotals({ }} value={amountToCurrency(data[balanceTypeOp])} title={ - Math.abs(data[balanceTypeOp]) > 100000 && - amountToCurrency(data[balanceTypeOp]) + Math.abs(data[balanceTypeOp]) > 100000 + ? amountToCurrency(data[balanceTypeOp]) + : undefined } width="flex" privacyFilter @@ -149,8 +153,9 @@ export function ReportTableTotals({ }} value={integerToCurrency(Math.round(average))} title={ - Math.abs(Math.round(average / 100)) > 100000 && - integerToCurrency(Math.round(average)) + Math.abs(Math.round(average / 100)) > 100000 + ? integerToCurrency(Math.round(average)) + : undefined } width="flex" privacyFilter diff --git a/upcoming-release-notes/2249.md b/upcoming-release-notes/2249.md new file mode 100644 index 00000000000..b5607975078 --- /dev/null +++ b/upcoming-release-notes/2249.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [carkom] +--- + +Fixing a bug where custom reports table graph crashes due to a type mismatch error. diff --git a/upcoming-release-notes/2251.md b/upcoming-release-notes/2251.md new file mode 100644 index 00000000000..145d3e73021 --- /dev/null +++ b/upcoming-release-notes/2251.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +Fix 'delete file' button always deleting the cloud file.