Leon před 1 rokem
rodič
revize
53c4fe89b3

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
android/app/src/main/assets/index.android.bundle


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
android/app/src/main/assets/index.android.map


+ 23 - 14
src/features/trackTimeDuration/components/CheckAccess.tsx

@@ -13,16 +13,18 @@ import Taro from "@tarojs/taro";
 import { useTranslation } from "react-i18next";
 import { kIsIOS } from "@/utils/tools";
 import { ColorType } from "@/context/themes/color";
+// import { useIsFocused } from "@react-navigation/native";
 
 let confirmAction: any = null;
 let cancelAction: any = null;
 let timer;
 let access;
-let useNavigation, AppState, Modal;
+let useNavigation, AppState, Modal,useIsFocused;
 if (process.env.TARO_ENV == 'rn') {
     AppState = require("react-native").AppState
     Modal = require("react-native").Modal
     useNavigation = require("@react-navigation/native").useNavigation
+    useIsFocused = require("@react-navigation/native").useIsFocused
 }
 
 const CheckAccess = memo((props: { record: any, count: number, access: any }) => {
@@ -48,8 +50,10 @@ const CheckAccess = memo((props: { record: any, count: number, access: any }) =>
     const dispatch = useDispatch();
 
     let navigation;
+    let isFocused = false;
     if (useNavigation) {
         navigation = useNavigation()
+        isFocused = useIsFocused()
     }
 
 
@@ -104,6 +108,7 @@ const CheckAccess = memo((props: { record: any, count: number, access: any }) =>
     // };
 
     function viewWillAppear() {
+        console.log('access page appear')
         setRnKeep(true)
         if (checkChooseMixed && chooseMixedSuccess) {
             upgradeSuccess()
@@ -114,14 +119,14 @@ const CheckAccess = memo((props: { record: any, count: number, access: any }) =>
     }
 
     function viewWillDisappear() {
-        debugger
+        console.log('access page disappear')
         setRnKeep(false)
     }
 
-    useDidShow(() => {
-        console.log('user did show');
-        viewWillAppear()
-    })
+    // useDidShow(() => {
+    //     console.log('user did show');
+    //     viewWillAppear()
+    // })
 
     useEffect(() => {
         if (process.env.TARO_ENV == 'rn') {
@@ -256,13 +261,7 @@ const CheckAccess = memo((props: { record: any, count: number, access: any }) =>
         setShowFastAlert(false)
     }
 
-    function pay() {
-        jumpPage('', 'ProductList', navigation)
-        setTimeout(() => {
-            confirmAction = pay
-            cancelAction = changeFastScenaria
-        }, 200)
-    }
+    
 
     async function loseGain(access) {
         var showedDisqualifiedAlert = await getStorage('showedDisqualifiedAlert') || false;
@@ -357,6 +356,8 @@ const CheckAccess = memo((props: { record: any, count: number, access: any }) =>
         }
     }
 
+    
+
     function upgrade() {
         const { prev_input, valid, start_time, end_time } = global.ring.schedule.sleep
         if (prev_input && valid) {
@@ -426,6 +427,14 @@ const CheckAccess = memo((props: { record: any, count: number, access: any }) =>
 
     }
 
+    function pay() {
+        jumpPage('', 'ProductList', navigation)
+        setTimeout(() => {
+            confirmAction = pay
+            cancelAction = changeFastScenaria
+        }, 200)
+    }
+
     function cancelSetting() {
         const { start_time, end_time } = global.ring.schedule.fast
         var params: any = {
@@ -509,7 +518,7 @@ const CheckAccess = memo((props: { record: any, count: number, access: any }) =>
             showFastAlert && process.env.TARO_ENV == 'weapp' && alertPop()
         }
         {
-            showFastAlert && rnKeep && process.env.TARO_ENV == 'rn' && <Modal transparent={true}>
+            showFastAlert && isFocused && process.env.TARO_ENV == 'rn' && <Modal transparent={true}>
                 <View style={{ backgroundColor: 'rgba(0,0,0,0.95)', width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center' }}>
                     {alertPop()}
                 </View>

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů