From 144eef310509615965fc82ca3cb606f0ec45fde3 Mon Sep 17 00:00:00 2001 From: shrouxm Date: Wed, 29 Jan 2025 13:58:57 -0800 Subject: [PATCH 1/2] fix: screen data requirement bugs --- dev-client/src/screens/SlopeScreen/SlopeShapeScreen.tsx | 3 +-- dev-client/src/screens/SlopeScreen/SlopeSteepnessScreen.tsx | 3 +-- dev-client/src/store/selectors.ts | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dev-client/src/screens/SlopeScreen/SlopeShapeScreen.tsx b/dev-client/src/screens/SlopeScreen/SlopeShapeScreen.tsx index fb7c04654..21e91853a 100644 --- a/dev-client/src/screens/SlopeScreen/SlopeShapeScreen.tsx +++ b/dev-client/src/screens/SlopeScreen/SlopeShapeScreen.tsx @@ -79,7 +79,6 @@ type CombinedSlope = `${SoilIdSoilDataDownSlopeChoices}:${SoilIdSoilDataCrossSlopeChoices}`; export const SlopeShapeScreen = ({siteId}: Props) => { - const name = useSelector(state => state.site.sites[siteId].name); const {t} = useTranslation(); const {downSlope, crossSlope} = useSelector(selectSoilData(siteId)); const dispatch = useDispatch(); @@ -160,7 +159,7 @@ export const SlopeShapeScreen = ({siteId}: Props) => { {() => ( } + AppBar={} BottomNavigation={null}> { - const name = useSelector(state => state.site.sites[siteId].name); const {t} = useTranslation(); const soilData = useSelector(selectSoilData(siteId)); const dispatch = useDispatch(); @@ -150,7 +149,7 @@ export const SlopeSteepnessScreen = ({siteId}: Props) => { {() => ( } + AppBar={} BottomNavigation={null}> useProjectSoilSettingsBase(projectId); export const useSiteProjectSoilSettings = (siteId: string) => - useProjectSoilSettingsBase(useSelector(selectSite(siteId)).projectId); + useProjectSoilSettingsBase(useSelector(selectSite(siteId))?.projectId); export type AggregatedInterval = { isFromPreset: boolean; From 7a061db689738cc59cbca13516a741c885c67223 Mon Sep 17 00:00:00 2001 From: shrouxm Date: Wed, 29 Jan 2025 16:06:59 -0800 Subject: [PATCH 2/2] fix: navigation interaction for returning to site tabs --- dev-client/src/components/dataRequirements/handleMissingData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-client/src/components/dataRequirements/handleMissingData.ts b/dev-client/src/components/dataRequirements/handleMissingData.ts index e4ab30285..c12085577 100644 --- a/dev-client/src/components/dataRequirements/handleMissingData.ts +++ b/dev-client/src/components/dataRequirements/handleMissingData.ts @@ -50,7 +50,7 @@ export const useNavToSiteAndShowSyncError = (siteId: string) => { const syncNotifications = useSyncNotificationContext(); return useCallback(() => { - navigation.navigate('SITE_TABS', {siteId: siteId}); + navigation.popTo('SITE_TABS', {siteId: siteId}); if (isFlagEnabled('FF_offline')) { syncNotifications.showError(); }