import { View, Text, Image, PageContainer } from '@tarojs/components' import './IndexConsole.scss' import { useTranslation } from 'react-i18next' import { useDispatch, useSelector } from 'react-redux'; import { endFast, endSleep, getLocalPush, startFast, startSleep, uploadLocalPushInfo } from "../actions/TrackTimeActions"; import { jumpPage } from '../hooks/Common'; import { useContext, useEffect, useRef, useState } from 'react'; import ConsolePicker from './ConsolePicker'; import LimitPickers from '@/components/input/LimitPickers'; import LimitTimeoutPickers from '@/components/input/LimitTimeoutPickers'; import { getColor, getTimePickerTitle } from '../hooks/Console'; import { kIsIOS, rpxToPx, vibrate } from '@/utils/tools'; import { TimeFormatter } from '@/utils/time_format'; import Modal from '@/components/layout/Modal.weapp'; import Taro, { useDidShow } from '@tarojs/taro'; import { wxPubFollow } from '@/services/permission'; import { setWXFollow } from '@/store/permission'; import CircadianDetailPopup from './CircadianDetailPopup'; import showAlert from '@/components/basic/Alert'; import CheckAccess from './CheckAccess'; import { ColorType } from '@/context/themes/color'; import IndexConsoleMuti from './IndexConsoleMuti'; let useNavigation; let Linking, PushNotification; let checkNotification; if (process.env.TARO_ENV == 'rn') { useNavigation = require("@react-navigation/native").useNavigation Linking = require('react-native').Linking; // JPush = require('jpush-react-native').default; PushNotification = require('react-native-push-notification') checkNotification = require('@/utils/native_permission_check').checkNotification; } let operateType = '' let min = 0 let max = 0 let defaultTimestamp = 0 let isTimeout = false let stageIndex = 0 let nativePushListener = null export default function IndexConsole(props: { record: any, count: number, access: any }) { const user = useSelector((state: any) => state.user); const { status } = props.record.current_record; const currentRecord = props.record.current_record; const { t } = useTranslation() const [fastDuration, setFastDuration] = useState(0); const [sleepDuration, setSleepDuration] = useState(0); const [expand, setExpand] = useState(false); const permission = useSelector((state: any) => state.permission); const common = useSelector((state: any) => state.common); const [firstEnter, setFirstEnter] = useState(true); const dayMilliSeconds = 24 * 3600 * 1000; const [btnDisable, setBtnDisable] = useState(false) const [showStageModal, setShowStageModal] = useState(false) const [showTimePicker, setShowTimePicker] = useState(false); const [showMutiPicker, setShowMutiPicker] = useState(false); const [mutiEvent, setMutiEvent] = useState('start_fast'); const [logEvent,setLogEvent] = useState('LOG_ONCE'); const [logEventTimestamp,setLogEventTimestamp] = useState(0) const dispatch = useDispatch(); const limitPickerRef = useRef(null) let navigation; if (useNavigation) { navigation = useNavigation() } useDidShow(() => { if (process.env.TARO_ENV == 'weapp') { wxPubFollow({ force_refresh: true }).then(res => { dispatch(setWXFollow((res as any).wx_pub_followed)); }) } }) useEffect(() => { if (process.env.TARO_ENV == 'rn') { // console.error('current status',status) var NativeAppEventEmitter = require('react-native').NativeAppEventEmitter; if (nativePushListener) { (nativePushListener as any).remove() } if (kIsIOS) { var Jto = require('react-native').NativeModules.NativeBridge; Jto.getNotificationAuthStatus() } nativePushListener = NativeAppEventEmitter.addListener('notificationReceive', (data) => { console.log('notification receive action', data) const { category_id, action_id, id,timestamp } = data uploadLocalPushInfo({ messageId: id }) global.set_time = timestamp; setLogEvent('NOTIFY_ONE_TAP'); // setLogEvent(timestamp) switch (action_id) { case 'START_TIMER_NOW': { if (category_id == 'REMINDER_FS_START_FAST') { operateType = 'startFast' } else { operateType = 'startSleep' } global.set_time = timestamp//new Date().getTime() pickerConfirm(timestamp,'NOTIFY_ONE_TAP') // pickerConfirm(new Date().getTime()) } break; case 'PICK_EARLIER_START': { if (category_id == 'REMINDER_FS_START_FAST') { tapStartFast(null) } else { tapStartSleep(null) } } break; case 'LOG_MY_TIMES': { if (category_id == 'REMINDER_FS_START_FAST_T2') { if (props.record.scenario.name == 'FAST_SLEEP') { tapStartSleep(null) } else { tapEndFast(null) } } if (props.record.scenario.name == 'FAST') { return } if (category_id == 'REMINDER_FS_START_FAST_T3') { tapEndSleep(null) } else if (category_id == 'REMINDER_FS_START_FAST_T4') { tapEndFast(null) } else if (category_id == 'REMINDER_FS_START_SLEEP_T3') { tapEndSleep(null) } else if (category_id == 'REMINDER_FS_START_SLEEP_T4') { tapEndFast(null) } else if (category_id == 'REMINDER_FS_END_SLEEP_T4') { tapEndFast(null) } } break; case 'END_TIMER_NOW': { if (category_id == 'REMINDER_FS_END_FAST') { operateType = 'endFast' } else { operateType = 'endSleep' } global.set_time = timestamp//new Date().getTime() pickerConfirm(timestamp,'NOTIFY_ONE_TAP') // pickerConfirm(new Date().getTime()) } break; case 'PICK_EARLIER_END': { if (category_id == 'REMINDER_FS_END_FAST') { tapEndFast(null) } else { tapEndSleep(null) } } break; case 'SKIP': break; } }) } }, [props.record]) useEffect(() => { if (currentRecord.fast) { var fastCount = currentRecord.fast.target_end_time - currentRecord.fast.target_start_time setFastDuration(fastCount) } if (currentRecord.sleep) { var sleepCount = currentRecord.sleep.target_end_time - currentRecord.sleep.target_start_time setSleepDuration(sleepCount) } if (props.record.current_record.status == 'WAIT_FOR_START') { setExpand(false) } }, [props.record]) function tapStartFast(e) { if (process.env.TARO_ENV == 'weapp') { e.stopPropagation() } if (!user.isLogin) { jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation) return } if (e){ setLogEvent('LOG_ONCE') } operateType = 'startFast' global.pauseIndexTimer = true global.set_time = e?new Date().getTime():logEventTimestamp defaultTimestamp = e?new Date().getTime():logEventTimestamp min = defaultTimestamp - 1 * 24 * 3600 * 1000 max = defaultTimestamp isTimeout = false setShowTimePicker(true) // showPicker() } function tapStartSleep(e) { if (process.env.TARO_ENV == 'weapp') { e.stopPropagation() } if (!user.isLogin) { jumpPage('/pages/account/ChooseAuth', 'ChooseAuth') return } if (e){ setLogEvent('LOG_ONCE') } if (status != 'ONGOING1' && props.record.scenario.name == 'FAST_SLEEP') { // if (status == 'WAIT_FOR_START') { // Taro.showToast({ // title: t('feature.track_time_duration.console.lock_fast_tip'), // icon: 'none' // }) // } // vibrate() setMutiEvent('start_sleep') setShowMutiPicker(true); return; } operateType = 'startSleep' global.pauseIndexTimer = true global.set_time = e?new Date().getTime():logEventTimestamp isTimeout = false if (props.record.scenario.name == 'SLEEP') { defaultTimestamp = e?new Date().getTime():logEventTimestamp min = defaultTimestamp - 6 * dayMilliSeconds max = defaultTimestamp } else { //todolist var now = new Date().getTime() var last_check_time = props.record.current_record.last_real_check_time if (now - last_check_time >= dayMilliSeconds) { //ongoing1 严重超时单独处理 // var schedule_start_time = props.record.current_record.sleep.target_start_time // defaultTimestamp = Math.min(now, schedule_start_time) // min = Math.max(last_check_time, schedule_start_time - 3 * dayMillionSeconds) // max = Math.min(now, schedule_start_time + 3 * dayMillionSeconds) defaultTimestamp = now min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds) max = defaultTimestamp } else { defaultTimestamp = now min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds) max = defaultTimestamp } } setShowTimePicker(true) // showPicker() } function tapEndSleep(e) { if (process.env.TARO_ENV == 'weapp') { e.stopPropagation() } if (!user.isLogin) { jumpPage('/pages/account/ChooseAuth', 'ChooseAuth') return } if (e){ setLogEvent('LOG_ONCE') } if (status != 'ONGOING2' && status != 'ONGOING') { // Taro.showToast({ // title: t('feature.track_time_duration.console.lock_sleep_tip'), // icon: 'none' // }) // vibrate() setMutiEvent('end_sleep') setShowMutiPicker(true); return; } operateType = 'endSleep' global.pauseIndexTimer = true global.set_time = e?new Date().getTime():logEventTimestamp var real_start_time = props.record.current_record.sleep.real_start_time var last_check_time = props.record.current_record.last_real_check_time var now = new Date().getTime() if (now - real_start_time >= dayMilliSeconds) { //严重超时 isTimeout = true // defaultTimestamp = Math.min(props.record.current_record.sleep.target_end_time, now) // min = Math.max(last_check_time, defaultTimestamp - 3 * dayMillionSeconds) // max = Math.min(now, defaultTimestamp + 3 * dayMillionSeconds) defaultTimestamp = now min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds) max = defaultTimestamp } else { isTimeout = false defaultTimestamp = e?new Date().getTime():logEventTimestamp min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds) max = defaultTimestamp } setShowTimePicker(true) // if (last_check_time + 24 * 3600 * 1000 <= new Date().getTime()) { // setShowTimePicker(true) // return // } // showPicker() } function tapEndFast(e) { if (process.env.TARO_ENV == 'weapp') { e.stopPropagation() } if (!user.isLogin) { jumpPage('/pages/account/ChooseAuth', 'ChooseAuth') return } if (e){ setLogEvent('LOG_ONCE') } if (status == 'WAIT_FOR_START') { // Taro.showToast({ // title: t('feature.track_time_duration.console.lock_fast_tip'), // icon: 'none' // }) // vibrate() setMutiEvent('end_fast') setShowMutiPicker(true); return; } if (status == 'ONGOING1') { // showAlert({ // title:t('feature.heads_up.alert_title'), // content:t('feature.heads_up.ongoing1_content'), // cancelText:t('feature.heads_up.ongoing1_cancel'), // confirmText:t('feature.heads_up.ongoing1_confirm'), // showCancel:true, // cancel:()=>{ // }, // confirm:()=>{ // tapEndFastOperate() // } // }) setMutiEvent('end_fast') setShowMutiPicker(true); return } else if (status == 'ONGOING2') { setMutiEvent('end_fast') setShowMutiPicker(true); // showAlert({ // title: t('feature.heads_up.alert_title'), // content: t('feature.heads_up.ongoing2_content'), // cancelText: t('feature.heads_up.ongoing2_cancel'), // confirmText: t('feature.heads_up.ongoing2_confirm'), // showCancel: true, // cancel: () => { // }, // confirm: () => { // tapEndFastOperate() // } // }) return } tapEndFastOperate(e) } function tapEndFastOperate(e) { operateType = 'endFast' global.pauseIndexTimer = true global.set_time = e?new Date().getTime():logEventTimestamp var real_start_time = props.record.current_record.fast.real_start_time var last_check_time = props.record.current_record.last_real_check_time var now = e?new Date().getTime():logEventTimestamp if (now - real_start_time >= dayMilliSeconds) { //严重超时 isTimeout = true defaultTimestamp = now min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds) max = defaultTimestamp } else { isTimeout = false defaultTimestamp = now min = Math.max(last_check_time, defaultTimestamp - 6 * dayMilliSeconds) max = defaultTimestamp } setShowTimePicker(true) } function layoutContent() { var limit = global.set_time - 7 * 3600 * 1000 * 24; global.limit = limit if (currentRecord.last_real_check_time) { limit = currentRecord.last_real_check_time global.limit = limit //当set_time秒数<=latest_record_time秒数时,最小限制时间戳需+1分钟 if (new Date(global.set_time).getSeconds() <= new Date(currentRecord.last_real_check_time).getSeconds() && global.set_time - currentRecord.last_real_check_time > 60000) { limit = limit + 60 * 1000 } } var title = getTimePickerTitle(currentRecord, t, operateType == 'endFast') var color = getColor(currentRecord, operateType == 'endFast') var duration = 0 if (operateType == 'startFast' && currentRecord.fast) { duration = currentRecord.fast.target_end_time - currentRecord.fast.target_start_time } if (operateType == 'startSleep' && currentRecord.sleep) { duration = currentRecord.sleep.target_end_time - currentRecord.sleep.target_start_time } var endTimestamp = 0 if (operateType == 'endFast') { endTimestamp = currentRecord.fast.target_end_time } else if (operateType == 'endSleep') { endTimestamp = currentRecord.sleep.target_end_time } return { pickerConfirm(e,null) global.pauseIndexTimer = false // hidePicker() }} /> } function timePickerContent() { var title = getTimePickerTitle(currentRecord, t, operateType == 'endFast') var color = getColor(currentRecord, operateType == 'endFast') // var limit = props.record.current_record.last_real_check_time // var targetTime = props.record.current_record.fast.target_end_time // if (props.record.current_record.status == 'ONGOING3') { // limit = 0 // targetTime = props.record.current_record.sleep.real_end_time + 60 * 1000 // } var endTimestamp = 0 if (operateType == 'endFast') { endTimestamp = currentRecord.fast.target_end_time } else if (operateType == 'endSleep') { endTimestamp = currentRecord.sleep.target_end_time } var duration = 0 if (operateType == 'startFast' && currentRecord.fast) { duration = currentRecord.fast.target_end_time - currentRecord.fast.target_start_time } if (operateType == 'startSleep' && currentRecord.sleep) { duration = currentRecord.sleep.target_end_time - currentRecord.sleep.target_start_time } return { pickerConfirm(e,null) global.pauseIndexTimer = false }} /> {/* { pickerConfirm(e) global.pauseIndexTimer = false }} /> */} } function showPicker() { // global.scenario = 'FAST_SLEEP' if (global.testInfotimer) { return } global.pauseIndexTimer = true global.set_time = new Date().getTime() updateNodeInfo() if (!global.isDebug) { return } // global.testInfotimer = setInterval(() => { // updateNodeInfo() // }, 1000) } function updateNodeInfo() { var node = layoutContent() global.showIndexModal(true, node, null); } function hidePicker() { var node = layoutContent() global.showIndexModal(false, node, null); setShowTimePicker(false) setBtnDisable(false) global.pauseIndexTimer = false } function followWxPub() { const resource = common.resources.filter((item: any) => { return item.code == 'follow_wx_pub' }) jumpPage('/pages/common/H5?title=fast16cc 关注服务号&url=' + resource[0].url) } function pickerConfirm(t1: number,event:any) { if (btnDisable) { return } setBtnDisable(true) // hidePicker() var date = new Date(t1) var setDate = new Date(global.set_time); date.setMilliseconds(setDate.getMilliseconds()); date.setSeconds(setDate.getSeconds()); t1 = date.getTime(); switch (operateType) { case 'startFast': startFast(t1, fastDuration,event?event:logEvent).then(res => { global.indexPageRefresh() setFirstEnter(false) hidePicker() setBtnDisable(false) refreshDayNight() if (process.env.TARO_ENV == 'weapp') { if (permission.wxPubFollow) { // showAlert({ // title: t('feature.track_time_duration.reminders.fast_end_title'), // content: // t('feature.track_time_duration.reminders.enable_post_fast_content', // { date: TimeFormatter.dateDescription(t1 + fastDuration, true), time: TimeFormatter.timeDescription(t1 + fastDuration) } // ), // showCancel: false, // confirmText: t('feature.track_time_duration.reminders.ok') // }) } else { showAlert({ title: t('feature.track_time_duration.reminders.fast_end_title'), content: t('feature.track_time_duration.reminders.post_fast_content', { date: TimeFormatter.dateDescription(t1 + fastDuration, true), time: TimeFormatter.timeDescription(t1 + fastDuration) } ), showCancel: true, cancelText: t('feature.track_time_duration.reminders.later'), confirmText: t('feature.track_time_duration.reminders.open'), confirm: () => { followWxPub() } }) } } else { PushNotification.checkPermissions((res) => { //允许授权 if ((kIsIOS && res.authorizationStatus == 2) || (!kIsIOS && res.alert)) { getLocalPush() // showAlert({ // title: t('feature.track_time_duration.reminders.fast_end_title'), // content: // t('feature.track_time_duration.reminders.enable_post_fast_content', // { date: TimeFormatter.dateDescription(t1 + fastDuration, true), time: TimeFormatter.timeDescription(t1 + fastDuration) } // ), // showCancel: false, // confirmText: t('feature.track_time_duration.reminders.ok') // }) } else { showAlert({ title: t('feature.track_time_duration.reminders.fast_end_title'), content: t('feature.track_time_duration.reminders.post_fast_content', { date: TimeFormatter.dateDescription(t1 + fastDuration, true), time: TimeFormatter.timeDescription(t1 + fastDuration) } ), showCancel: true, cancelText: t('feature.track_time_duration.reminders.later'), confirmText: t('feature.track_time_duration.reminders.open'), confirm: () => { // Linking.openURL('app-settings:notifications') checkNotification() } }) } }) } }).catch(e => { setBtnDisable(false) }) break case 'startSleep': startSleep(t1, sleepDuration,event?event:logEvent).then(res => { global.indexPageRefresh() setFirstEnter(false) hidePicker() setBtnDisable(false) refreshDayNight() if (process.env.TARO_ENV == 'weapp') { if (permission.wxPubFollow) { // showAlert({ // title: t('feature.track_time_duration.reminders.wake_title'), // content: // t('feature.track_time_duration.reminders.enable_post_sleep_content', // { date: TimeFormatter.dateDescription(t1 + sleepDuration, true), time: TimeFormatter.timeDescription(t1 + sleepDuration) }), // showCancel: false, // confirmText: t('feature.track_time_duration.reminders.ok') // }) } else { showAlert({ title: t('feature.track_time_duration.reminders.wake_title'), content: t('feature.track_time_duration.reminders.post_sleep_content', { date: TimeFormatter.dateDescription(t1 + sleepDuration, true), time: TimeFormatter.timeDescription(t1 + sleepDuration) }), cancelText: t('feature.track_time_duration.reminders.later'), confirmText: t('feature.track_time_duration.reminders.open'), showCancel: true, confirm: () => { followWxPub() } }) } } else { PushNotification.checkPermissions((res) => { //允许授权 if ((kIsIOS && res.authorizationStatus == 2) || (!kIsIOS && res.alert)) { getLocalPush() // showAlert({ // title: t('feature.track_time_duration.reminders.wake_title'), // content: // t('feature.track_time_duration.reminders.enable_post_sleep_content', // { date: TimeFormatter.dateDescription(t1 + sleepDuration, true), time: TimeFormatter.timeDescription(t1 + sleepDuration) }), // showCancel: false, // confirmText: t('feature.track_time_duration.reminders.ok') // }) } else { showAlert({ title: t('feature.track_time_duration.reminders.wake_title'), content: t('feature.track_time_duration.reminders.post_sleep_content', { date: TimeFormatter.dateDescription(t1 + sleepDuration, true), time: TimeFormatter.timeDescription(t1 + sleepDuration) }), cancelText: t('feature.track_time_duration.reminders.later'), confirmText: t('feature.track_time_duration.reminders.open'), showCancel: true, confirm: () => { checkNotification() // Linking.openURL('app-settings:notifications') } }) } }) } }).catch((e) => { setBtnDisable(false) var picker = limitPickerRef.current; (picker as any).resetPickerData() }) break case 'endSleep': endSleep(t1,event?event:logEvent).then(res => { getLocalPush() setBtnDisable(false) global.indexPageRefresh() setFirstEnter(false) hidePicker() global.refrehWeekly() global.refreshStreaks() refreshDayNight() if (props.record.current_record.scenario == 'SLEEP') { global.scrollToLatest() } }).catch((e) => { setBtnDisable(false) var picker = limitPickerRef.current; (picker as any).resetPickerData() }) break case 'endFast': endFast(t1,event?event:logEvent).then(res => { getLocalPush() setBtnDisable(false) global.indexPageRefresh() setFirstEnter(false) hidePicker() global.scrollToLatest() global.refrehWeekly() global.refreshStreaks() refreshDayNight() global.checkAccess((res as any).access) // checkAccessProvisional((res as any).access,showFastAlert) }).catch((e) => { setBtnDisable(false) var picker = limitPickerRef.current; (picker as any).resetPickerData() }) break } } function refreshDayNight() { if (global.refreshNight) { global.refreshNight() } if (global.refreshDay) { global.refreshDay() } } function expandBtnText() { if (status == 'WAIT_FOR_START') { return t('feature.track_time_duration.console.next_steps') } else if (firstEnter) { return t('feature.track_time_duration.console.show_more') } return t('feature.track_time_duration.console.next_steps') } function modalContent() { global.set_time = new Date().getTime() return { hidePicker() // setShowTimeoutPicker(false) }} confirm={() => { }}> { timePickerContent() } } function mutiContent() { return { setShowMutiPicker(false) }} confirm={() => { }}> { mutiPickerContent() } } function mutiPickerContent() { global.set_time = new Date().getTime() return setShowMutiPicker(false)} /> } function single() { if (props.record.scenario.name == 'FAST') { return { status == 'WAIT_FOR_START' && {t('feature.track_time_duration.common.start_fast')} } {/* { status != 'WAIT_FOR_START' && } */} { status == 'ONGOING' && {t('feature.track_time_duration.common.end_fast')} } { status == 'WAIT_FOR_START' && { !expand && { setExpand(true) }}>{expandBtnText()} } } {status == 'WAIT_FOR_START' && expand && } { status == 'WAIT_FOR_START' && expand && {t('feature.track_time_duration.common.end_fast')} } { showTimePicker && modalContent() } { showMutiPicker && mutiContent() } } else if (props.record.scenario.name == 'SLEEP') { return { status == 'WAIT_FOR_START' && {t('feature.track_time_duration.common.start_sleep')} } {/* { status != 'WAIT_FOR_START' && } */} { status == 'ONGOING' && {t('feature.track_time_duration.common.end_sleep')} } { showTimePicker && modalContent() } } } function mixed() { return { status == 'WAIT_FOR_START' ? {t('feature.track_time_duration.common.start_fast')} : { tapStage(0) }} className='stage_btn'> {t('feature.track_time_duration.stage.a')} { status == 'ONGOING1' ? {TimeFormatter.countdown(currentRecord.fast.real_start_time)} : {TimeFormatter.calculateTimeDifference(currentRecord.fast.real_start_time, currentRecord.sleep.real_start_time)} } } { (status == 'WAIT_FOR_START' || status == 'ONGOING1') && {t('feature.track_time_duration.common.start_sleep')} } { (status != 'WAIT_FOR_START' && status != 'ONGOING1') && { tapStage(1) }} className='stage_btn'> {t('feature.track_time_duration.stage.b')} { status == 'ONGOING2' ? {TimeFormatter.countdown(currentRecord.sleep.real_start_time)} : {TimeFormatter.calculateTimeDifference(currentRecord.sleep.real_start_time, currentRecord.sleep.real_end_time)} } } {(expand || (status != 'WAIT_FOR_START' && status != 'ONGOING1')) && } { (expand || (status != 'WAIT_FOR_START' && status != 'ONGOING1')) && (status == 'WAIT_FOR_START' || status == 'ONGOING1' || status == 'ONGOING2') && {t('feature.track_time_duration.common.end_sleep')} } { status == 'ONGOING3' && { tapStage(2) }} className='stage_btn'> {t('feature.track_time_duration.stage.c')} {TimeFormatter.countdown(currentRecord.sleep.real_end_time)} } {(expand || status == 'ONGOING3' || status == 'ONGOING') && } { (expand || status == 'ONGOING3' || status == 'ONGOING') && {t('feature.track_time_duration.common.end_fast')} } { (status == 'WAIT_FOR_START' || status == 'ONGOING1' || status == 'ONGOING2') && { !expand && { setExpand(true) }}>{expandBtnText()} } } { showTimePicker && modalContent() } { showStageModal && stageContent() } { showMutiPicker && mutiContent() } } function stageContent() { return { global.pauseIndexTimer = false setShowStageModal(false) }} confirm={() => { }}> { { setShowStageModal(false); }} /> } } function tapStage(index) { stageIndex = index setShowStageModal(true) } return { props.record.scenario.name == 'FAST_SLEEP' ? mixed() : single() } }