Skip to content

Commit

Permalink
fix: add early exit to delete and disable
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMuzyk committed Mar 8, 2024
1 parent d47fc8b commit 546e706
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pages/workspace/distanceRates/PolicyDistanceRatesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function PolicyDistanceRatesPage({policy, route}: PolicyDistanceRatesPageProps)
const disableRates = () => {
if (selectedDistanceRates.length !== Object.values(customUnitRates).length) {
// run enableWorkspaceDistanceRates for all selected rows
return;
}

setIsWarningModalVisible(true);
Expand All @@ -125,6 +126,7 @@ function PolicyDistanceRatesPage({policy, route}: PolicyDistanceRatesPageProps)
const deleteRates = () => {
if (selectedDistanceRates.length !== Object.values(customUnitRates).length) {
// run deleteWorkspaceDistanceRates for all selected rows
return;
}

setIsWarningModalVisible(true);
Expand Down

0 comments on commit 546e706

Please sign in to comment.