year 3 miesięcy temu
rodzic
commit
0d67e763a2

+ 7 - 1
src/app/[locale]/(TabBar)/[[...share]]/@actionWidget/Service.tsx

@@ -83,9 +83,10 @@ const WheelSection = () => {
     const pathname = usePathname();
     const wheelModalRef = useRef<WheelModalProps | null>(null);
     const [data, setData] = useState<any>([]);
-    const { modalShow, closeModalShow } = useModalShow((state: any) => ({
+    const { modalShow, closeModalShow, setModalShow } = useModalShow((state: any) => ({
         modalShow: state.modalShow,
         closeModalShow: state.closeModalShow,
+        setModalShow: state.setModalShow,
     }));
     const keyName = useMemo(() => {
         return "WheelSection";
@@ -111,6 +112,11 @@ const WheelSection = () => {
         }
     }, [modalShow, data, keyName, pathname]);
 
+    useEffect(() => {
+        setModalShow("WheelSection");
+        // eslint-disable-next-line react-hooks/exhaustive-deps
+    }, [pathname]);
+
     const destoryComponent = () => {
         if (modalShow === keyName) {
             closeModalShow(keyName);