Leon há 1 ano atrás
pai
commit
0051814cc3

+ 10 - 9
src/features/trackTimeDuration/components/IndexConsoleMuti.tsx

@@ -16,7 +16,7 @@ import { TimeFormatter } from "@/utils/time_format";
 let min = 0
 let max = 0
 let defaultTimestamp = 0
-export default function IndexConsoleMuti(props: { status: string, event: string, close: Function,scenario:string }) {
+export default function IndexConsoleMuti(props: { status: string, event: string, close: Function, scenario: string }) {
     const { t } = useTranslation();
     const isLoading = false;
     var color = ColorType.fast;
@@ -170,14 +170,15 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
             global.scrollToLatest()
             global.refrehWeekly()
             global.refreshStreaks()
-            global.checkAccess((res as any).access)
+            if (props.event == 'end_fast')
+                global.checkAccess((res as any).access)
 
             cancel()
         }).catch(e => {
 
         })
     }
-    
+
     function tapItem(index: number) {
         setShowPicker(true);
         switch (index) {
@@ -200,7 +201,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
         return <View className="new_item_cell" onClick={() => tapItem(0)}>
             <Text className="new_item_cell_title">{t('feature.track_time_duration.common.start_fast')}</Text>
             <View style={{ flex: 1 }} />
-            <Text className="new_item_cell_desc">{fastStart?TimeFormatter.dateTimeFormate(fastStart.time,true):'Pick Time'}</Text>
+            <Text className="new_item_cell_desc">{fastStart ? TimeFormatter.dateTimeFormate(fastStart.time, true) : 'Pick Time'}</Text>
             <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
         </View>
     }
@@ -209,7 +210,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
         return <View className="new_item_cell" onClick={() => tapItem(1)}>
             <Text className="new_item_cell_title">{t('feature.track_time_duration.common.start_sleep')}</Text>
             <View style={{ flex: 1 }} />
-            <Text className="new_item_cell_desc">{sleepStart?TimeFormatter.dateTimeFormate(sleepStart.time,true):'Pick Time'}</Text>
+            <Text className="new_item_cell_desc">{sleepStart ? TimeFormatter.dateTimeFormate(sleepStart.time, true) : 'Pick Time'}</Text>
             <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
         </View>
     }
@@ -218,7 +219,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
         return <View className="new_item_cell" onClick={() => tapItem(2)}>
             <Text className="new_item_cell_title">{t('feature.track_time_duration.common.end_sleep')}</Text>
             <View style={{ flex: 1 }} />
-            <Text className="new_item_cell_desc">{sleepEnd?TimeFormatter.dateTimeFormate(sleepEnd.time,true):'Pick Time'}</Text>
+            <Text className="new_item_cell_desc">{sleepEnd ? TimeFormatter.dateTimeFormate(sleepEnd.time, true) : 'Pick Time'}</Text>
             <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
         </View>
     }
@@ -227,7 +228,7 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
         return <View className="new_item_cell" onClick={() => tapItem(3)}>
             <Text className="new_item_cell_title">{t('feature.track_time_duration.common.end_fast')}</Text>
             <View style={{ flex: 1 }} />
-            <Text className="new_item_cell_desc">{fastEnd?TimeFormatter.dateTimeFormate(fastEnd.time,true):'Pick Time'}</Text>
+            <Text className="new_item_cell_desc">{fastEnd ? TimeFormatter.dateTimeFormate(fastEnd.time, true) : 'Pick Time'}</Text>
             <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
         </View>
     }
@@ -369,10 +370,10 @@ export default function IndexConsoleMuti(props: { status: string, event: string,
                 props.event == 'end_fast' && props.status == 'WAIT_FOR_START' && startFastCell()
             }
             {
-                props.event == 'end_fast' && props.scenario=='FAST_SLEEP' && (props.status == 'ONGOING1' || props.status == 'WAIT_FOR_START') && startSleepCell()
+                props.event == 'end_fast' && props.scenario == 'FAST_SLEEP' && (props.status == 'ONGOING1' || props.status == 'WAIT_FOR_START') && startSleepCell()
             }
             {
-                props.event == 'end_fast' && props.scenario=='FAST_SLEEP' && (props.status == 'ONGOING1' || props.status == 'ONGOING2' || props.status == 'WAIT_FOR_START') && endSleepCell()
+                props.event == 'end_fast' && props.scenario == 'FAST_SLEEP' && (props.status == 'ONGOING1' || props.status == 'ONGOING2' || props.status == 'WAIT_FOR_START') && endSleepCell()
             }
             {
                 props.event == 'end_fast' && endFastCell()