diff --git a/src/components/map/UseMap.tsx b/src/components/map/UseMap.tsx index 189caea..72b371c 100644 --- a/src/components/map/UseMap.tsx +++ b/src/components/map/UseMap.tsx @@ -28,12 +28,12 @@ const UseMap: React.FC = () => { const [branchCount, SetBranchCount] = useState(0); const [canBranchCount, SetCanBranchCount] = useState(0); const [isIOS, setIsIOS] = useState(false); + const [isStandalone, setIsStandalone] = useState(false); useEffect(() => { const userAgent = window.navigator.userAgent; - if (/iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream) { - setIsIOS(true); - } + setIsIOS(/iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream); + setIsStandalone(window.matchMedia('(display-mode: standalone)').matches); }, []); useEffect(() => { @@ -285,14 +285,13 @@ const UseMap: React.FC = () => { /> - {loading && (