Skip to content

Commit

Permalink
improve cases deleted check by asserting cases exist
Browse files Browse the repository at this point in the history
  • Loading branch information
bacalj committed Aug 12, 2024
1 parent 2a64a34 commit 614b5a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export const App: React.FC = () => {
const isResource = resource === `dataContextChangeNotice[${kDataContextName}]`;
if (!isResource) return;

const casesDeleted = values.operation === "selectCases" && values.result.cases && values.result.cases.length === 0 && values.result.success;
const casesDeleted =
values.operation === "selectCases"
&& values.result.cases
&& values.result.cases.length === 0
&& values.result.success;

if ( casesDeleted ) {
const uniqeLocations = await getUniqueLocationsRef.current();
Expand Down

0 comments on commit 614b5a3

Please sign in to comment.