Skip to content

fix: screen data requirement bugs #2851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 1 addition & 2 deletions dev-client/src/screens/SlopeScreen/SlopeShapeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -160,7 +159,7 @@ export const SlopeShapeScreen = ({siteId}: Props) => {
<ScreenDataRequirements requirements={requirements}>
{() => (
<ScreenScaffold
AppBar={<AppBar title={name} />}
AppBar={<AppBar title={site.name} />}
BottomNavigation={null}>
<SiteRoleContextProvider siteId={siteId}>
<ScrollView
Expand Down
3 changes: 1 addition & 2 deletions dev-client/src/screens/SlopeScreen/SlopeSteepnessScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ type Props = {
};

export const SlopeSteepnessScreen = ({siteId}: Props) => {
const name = useSelector(state => state.site.sites[siteId].name);
const {t} = useTranslation();
const soilData = useSelector(selectSoilData(siteId));
const dispatch = useDispatch();
Expand Down Expand Up @@ -150,7 +149,7 @@ export const SlopeSteepnessScreen = ({siteId}: Props) => {
<ScreenDataRequirements requirements={requirements}>
{() => (
<ScreenScaffold
AppBar={<AppBar title={name} />}
AppBar={<AppBar title={site.name} />}
BottomNavigation={null}>
<SiteRoleContextProvider siteId={siteId}>
<ScrollView
Expand Down
2 changes: 1 addition & 1 deletion dev-client/src/store/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export const useProjectSoilSettings = (projectId: string) =>
useProjectSoilSettingsBase(projectId);

export const useSiteProjectSoilSettings = (siteId: string) =>
useProjectSoilSettingsBase(useSelector(selectSite(siteId)).projectId);
useProjectSoilSettingsBase(useSelector(selectSite(siteId))?.projectId);

export type AggregatedInterval = {
isFromPreset: boolean;
Expand Down