|
@@ -1,13 +1,17 @@
|
|
|
"use client";
|
|
|
import { Link } from "@/i18n/routing";
|
|
|
import { useEffect, useState } from "react";
|
|
|
+function isWebView() {
|
|
|
+ const userAgent = window.navigator && navigator.userAgent;
|
|
|
|
|
|
+ return /WebView|iPhone|iPod|Android/.test(userAgent);
|
|
|
+}
|
|
|
const DownloadSection = () => {
|
|
|
const [visible, setVisible] = useState<boolean>(true);
|
|
|
|
|
|
useEffect(() => {
|
|
|
const isCloseDownload = sessionStorage.getItem("isCloseDownload");
|
|
|
- if (isCloseDownload) {
|
|
|
+ if (isWebView() || isCloseDownload) {
|
|
|
setVisible(false);
|
|
|
}
|
|
|
}, []);
|
|
@@ -16,12 +20,8 @@ const DownloadSection = () => {
|
|
|
sessionStorage.setItem("isCloseDownload", "true");
|
|
|
setVisible(false);
|
|
|
};
|
|
|
- function isWebView() {
|
|
|
- const userAgent = navigator.userAgent;
|
|
|
|
|
|
- return /WebView|iPhone|iPod|Android/.test(userAgent);
|
|
|
- }
|
|
|
- if (!visible || isWebView()) return null;
|
|
|
+ if (!visible) return null;
|
|
|
return (
|
|
|
<div
|
|
|
className={"relative flex items-center px-[0.1389rem] py-[0.0694rem]"}
|