From 090daae35259d8052a58eda0d4925f7c85975674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojtek=20Ba=C5=BCant?= Date: Sun, 9 Jun 2024 12:48:44 +0100 Subject: [PATCH] Fix display of add-location form (#395) Prevents the map from showing behind the add-location form. --- src/components/mobile/MobileLayout.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/mobile/MobileLayout.js b/src/components/mobile/MobileLayout.js index 733bfe7a..61f8a77d 100644 --- a/src/components/mobile/MobileLayout.js +++ b/src/components/mobile/MobileLayout.js @@ -33,12 +33,14 @@ const shouldDisplayMapPage = (pathname) => { exact: false, strict: false, }) - const isAddingLocation = match?.params.entryId === 'new' + const isPlacingNewLocationMarker = + match?.params.entryId === 'new' && match?.params.nextSegment !== 'details' + const entryId = match?.params.entryId && parseInt(match.params.entryId) // distinguish viewing a location from having it displayed during e.g. editing or review const isViewingLocation = entryId && match.params.nextSegment?.indexOf('@') === 0 - return isAddingLocation || isViewingLocation + return isPlacingNewLocationMarker || isViewingLocation } const MobileLayout = () => { const history = useAppHistory()