year hace 4 días
padre
commit
e703e902cf

+ 2 - 5
src/app/[locale]/(TabBar)/[[...share]]/@popupWidget/page.tsx

@@ -1,6 +1,3 @@
-import DesktopModal from "@/components/ModalPopup/DesktopModal";
-import { Suspense } from "react";
-
 const Page = async () => {
     return (
         <>
@@ -10,9 +7,9 @@ const Page = async () => {
             </Suspense> */}
 
             {/*安装弹窗*/}
-            <Suspense>
+            {/* <Suspense>
                 <DesktopModal source={"page"} />
-            </Suspense>
+            </Suspense> */}
         </>
     );
 };

+ 1 - 32
src/app/[locale]/providers.tsx

@@ -6,7 +6,6 @@ import ptBR from "antd-mobile/es/locales/pt-BR";
 import { ThemeProviderProps } from "next-themes/dist/types";
 import { ReactNode, useEffect, useState } from "react";
 
-import { usePathname } from "@/i18n/routing";
 import { server } from "@/utils/client";
 import { useDebounceEffect, useRequest } from "ahooks";
 import clsx from "clsx";
@@ -25,7 +24,6 @@ import { useGlobalNoticeStore } from "@/stores/useGlobalNoticeStore";
 import { getToken as getUserToken } from "@/utils/Cookies";
 
 import { PromotionRep } from "@/api/home";
-import feedback from "@/feedback";
 
 import { PollingState, usePollingStore } from "@/stores/usePollingStore";
 import { useSuspensionStore } from "@/stores/useSuspensionStore";
@@ -365,36 +363,7 @@ export default function SidebarLayout({ children, themeProps }: ProvidersProps)
         isCollapse: state.isCollapse,
         setCollapse: state.setCollapse,
     }));
-    const [popData, setPopData] = useState<PromotionRep[]>([]);
-    const pathname = usePathname();
-    useEffect(() => {
-        if (feedback.hasShowDialog()) {
-            feedback.hideDialog();
-        }
-        if (pathname !== "/") {
-            setPopData([]);
-            return;
-        }
-    }, [pathname]);
-
-    // const doShowProxyCheck = async () => {
-    //     const showProxy = sessionStorage.getItem("ShowProxy");
-    //     if (!showProxy) {
-    //         await feedback.showModal({
-    //             content: <Agent step={1}></Agent>,
-    //             width: "90%",
-    //             useDefaultFooter: false,
-    //             suffix: <AgentSuffix></AgentSuffix>,
-    //         });
-    //         await feedback.showModal({
-    //             content: <Agent step={2}></Agent>,
-    //             width: "90%",
-    //             useDefaultFooter: false,
-    //             suffix: <AgentSuffix></AgentSuffix>,
-    //         });
-    //         sessionStorage.setItem("ShowProxy", "1");
-    //     }
-    // };
+
     return (
         <div id={"app"} className="relative h-[100%] overflow-hidden">
             <motion.div

+ 12 - 0
src/app/[locale]/template.tsx

@@ -1,6 +1,8 @@
 "use client";
 
+import feedback from "@/feedback";
 import { usePathname, useRouter } from "@/i18n/routing";
+import { commonMask } from "@/utils";
 import { AnimatePresence, motion } from "framer-motion";
 import { LayoutRouterContext } from "next/dist/shared/lib/app-router-context.shared-runtime";
 import { ReactNode, useContext, useEffect, useRef } from "react";
@@ -36,6 +38,16 @@ function FrozenRouter(props: { children: ReactNode }) {
 const Template = ({ children }: { children: ReactNode }) => {
     const key = usePathname();
     const router = useRouter();
+    useEffect(() => {
+        dialogManage.hideAll();
+        if (feedback.hasShowDialog()) {
+            feedback.hideDialog();
+        }
+        setTimeout(() => {
+            commonMask.hide();
+        }, 500);
+    }, [key]);
+
     useEffect(() => {
         if (window) window.nextRouter = router;
     }, [router]);

+ 1 - 18
src/components/Layout/Sidebar.tsx

@@ -10,7 +10,7 @@ import { usePathname, useRouter } from "@/i18n/routing";
 import { useProviderStore } from "@/stores/useProvider";
 import { useSystemStore } from "@/stores/useSystemStore";
 import { useWalletStore } from "@/stores/useWalletStore";
-import { commonMask, isPWAorAPK } from "@/utils";
+import { isPWAorAPK } from "@/utils";
 import { server } from "@/utils/client";
 import { getToken } from "@/utils/Cookies";
 import { isAndroid, isIOS } from "@/utils/methods";
@@ -159,23 +159,6 @@ const Sidebar: FC<PropsWithChildren<Props>> = (props) => {
             setService: state.setService,
         }));
 
-    React.useEffect(() => {
-        // if (pathname !== "/") {
-        //     setTimeout(() => {
-        //         commonMask.hide();
-        //     }, 500);
-        // }
-        dialogManage.hideAll();
-        setTimeout(() => {
-            commonMask.hide();
-        }, 500);
-        // Router.events.on("routeChangeComplete", () => {
-        //     console.log(99990);
-        // });
-        // setTimeout(() => {
-        //     Router.events.emit("routeChangeComplete");
-        // }, 10000);
-    }, [pathname]);
     React.useEffect(() => {
         getApkInfo();
     }, []);

+ 2 - 3
src/utils/index.ts

@@ -122,11 +122,10 @@ export const commonMask = {
         }
     },
     hide() {
-        if (this.count > 1) {
-            this.count--;
+        this.count--;
+        if (this.count >= 1) {
             return;
         }
-        this.count--;
         if (typeof window === "undefined") return;
         var dom: HTMLDivElement | null = document?.querySelector("#globalMask");
         if (dom) {