Skip to content

Commit

Permalink
Fix typecheck error
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Jan 14, 2025
1 parent 0f13b05 commit 21abbb0
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions packages/desktop-client/src/components/modals/LoadBackupModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,16 @@ export function LoadBackupModal({
</Block>
<Button
variant="primary"
onPress={() =>
dispatch(
loadBackup({
budgetId: budgetIdToLoad,
backupId: latestBackup.id,
}),
)
}
onPress={() => {
if (budgetIdToLoad && latestBackup.id) {
dispatch(
loadBackup({
budgetId: budgetIdToLoad,
backupId: latestBackup.id,
}),
);
}
}}
>
{t('Revert to original version')}
</Button>
Expand Down Expand Up @@ -147,11 +149,13 @@ export function LoadBackupModal({
) : (
<BackupTable
backups={previousBackups}
onSelect={id =>
dispatch(
loadBackup({ budgetId: budgetIdToLoad, backupId: id }),
)
}
onSelect={id => {
if (budgetIdToLoad && id) {
dispatch(
loadBackup({ budgetId: budgetIdToLoad, backupId: id }),
);
}
}}
/>
)}
</View>
Expand Down

0 comments on commit 21abbb0

Please sign in to comment.