From 614b5a3d1367cda521c76d80f31e78e9e42382da Mon Sep 17 00:00:00 2001 From: Joe Bacal Date: Mon, 12 Aug 2024 11:28:05 -0400 Subject: [PATCH] improve cases deleted check by asserting cases exist --- src/components/App.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index e96e560..4bbb746 100755 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -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();