Skip to content

Commit af09e5b

Browse files
authored
Fix error on budget file selection page when using server (#4670)
* Fix error on budget file selection page when using server * Release notes
1 parent 8f12893 commit af09e5b

File tree

6 files changed

+26
-16
lines changed

6 files changed

+26
-16
lines changed

packages/desktop-client/src/components/Modals.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useDispatch } from '../redux';
1313
import { EditSyncAccount } from './banksync/EditSyncAccount';
1414
import { AccountAutocompleteModal } from './modals/AccountAutocompleteModal';
1515
import { AccountMenuModal } from './modals/AccountMenuModal';
16-
import { BudgetFileSelectionModal } from './modals/BudgetListModal';
16+
import { BudgetFileSelectionModal } from './modals/BudgetFileSelectionModal';
1717
import { BudgetPageMenuModal } from './modals/BudgetPageMenuModal';
1818
import { CategoryAutocompleteModal } from './modals/CategoryAutocompleteModal';
1919
import { CategoryGroupMenuModal } from './modals/CategoryGroupMenuModal';
@@ -335,7 +335,7 @@ export function Modals() {
335335
</NamespaceContext.Provider>
336336
);
337337

338-
case 'budget-list':
338+
case 'budget-file-selection':
339339
return <BudgetFileSelectionModal key={name} />;
340340
case 'delete-budget':
341341
return <DeleteFileModal key={name} {...modal.options} />;

packages/desktop-client/src/components/manager/BudgetFileSelection.tsx

+15-11
Original file line numberDiff line numberDiff line change
@@ -419,17 +419,21 @@ function BudgetFileList({
419419
</Text>
420420
)}
421421
>
422-
{file => (
423-
<BudgetFileListItem
424-
key={isLocalFile(file) ? file.id : file.cloudFileId}
425-
value={file}
426-
currentUserId={currentUserId}
427-
quickSwitchMode={quickSwitchMode}
428-
onSelect={onSelect}
429-
onDelete={onDelete}
430-
onDuplicate={onDuplicate}
431-
/>
432-
)}
422+
{file => {
423+
const id = isLocalFile(file) ? file.id : file.cloudFileId;
424+
return (
425+
<BudgetFileListItem
426+
key={id}
427+
id={id}
428+
value={file}
429+
currentUserId={currentUserId}
430+
quickSwitchMode={quickSwitchMode}
431+
onSelect={onSelect}
432+
onDelete={onDelete}
433+
onDuplicate={onDuplicate}
434+
/>
435+
);
436+
}}
433437
</GridList>
434438
);
435439
}

packages/desktop-client/src/components/mobile/budget/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ export function Budget() {
498498
);
499499

500500
const onSwitchBudgetFile = useCallback(() => {
501-
dispatch(pushModal({ modal: { name: 'budget-list' } }));
501+
dispatch(pushModal({ modal: { name: 'budget-file-selection' } }));
502502
}, [dispatch]);
503503

504504
const onOpenBudgetMonthMenu = useCallback(

packages/desktop-client/src/components/modals/BudgetListModal.tsx packages/desktop-client/src/components/modals/BudgetFileSelectionModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function BudgetFileSelectionModal() {
1717
);
1818

1919
return (
20-
<Modal name="budget-list">
20+
<Modal name="budget-file-selection">
2121
{({ state: { close } }) => (
2222
<>
2323
<ModalHeader

packages/loot-core/src/client/modals/modalsSlice.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ export type Modal =
453453
};
454454
}
455455
| {
456-
name: 'budget-list';
456+
name: 'budget-file-selection';
457457
}
458458
| {
459459
name: 'confirm-transaction-edit';

upcoming-release-notes/4670.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Bugfix
3+
authors: [joel-jeremy]
4+
---
5+
6+
Fix error on budget file selection page when using server

0 commit comments

Comments
 (0)