File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ function BaseRecordTroubleshootDataToolMenu({
8787 const styles = useThemeStyles ( ) ;
8888 const [ shouldRecordTroubleshootData ] = useOnyx ( ONYXKEYS . SHOULD_RECORD_TROUBLESHOOT_DATA , { canBeMissing : true } ) ;
8989 const [ capturedLogs ] = useOnyx ( ONYXKEYS . LOGS , { canBeMissing : true } ) ;
90- const [ isProfilingInProgress ] = useOnyx ( ONYXKEYS . APP_PROFILING_IN_PROGRESS , { canBeMissing : true } ) ;
90+ const [ isProfilingInProgress = false ] = useOnyx ( ONYXKEYS . APP_PROFILING_IN_PROGRESS , { canBeMissing : true } ) ;
9191 const [ shareUrls , setShareUrls ] = useState < string [ ] > ( ) ;
9292 const [ isDisabled , setIsDisabled ] = useState < boolean > ( false ) ;
9393
@@ -103,7 +103,7 @@ function BaseRecordTroubleshootDataToolMenu({
103103 } else {
104104 Performance . disableMonitoring ( ) ;
105105 }
106- toggleProfileTool ( ) ;
106+ toggleProfileTool ( { isProfilingInProgress } ) ;
107107 return ( ) => {
108108 Performance . disableMonitoring ( ) ;
109109 } ;
Original file line number Diff line number Diff line change @@ -3,18 +3,16 @@ import Onyx from 'react-native-onyx';
33import CONST from '@src/CONST' ;
44import ONYXKEYS from '@src/ONYXKEYS' ;
55
6- let isProfilingInProgress = false ;
7- Onyx . connect ( {
8- key : ONYXKEYS . APP_PROFILING_IN_PROGRESS ,
9- callback : ( val ) => ( isProfilingInProgress = val ?? false ) ,
10- } ) ;
6+ type ToggleProfileToolParams = {
7+ isProfilingInProgress : boolean ;
8+ } ;
119
1210/**
1311 * Toggle the test tools modal open or closed.
1412 * Throttle the toggle to make the modal stay open if you accidentally tap an extra time, which is easy to do.
1513 */
16- function toggleProfileTool ( ) {
17- const toggle = ( ) => Onyx . set ( ONYXKEYS . APP_PROFILING_IN_PROGRESS , ! isProfilingInProgress ) ;
14+ function toggleProfileTool ( { isProfilingInProgress } : ToggleProfileToolParams ) {
15+ const toggle = ( ) => Onyx . set ( ONYXKEYS . APP_PROFILING_IN_PROGRESS , isProfilingInProgress ) ;
1816 const throttledToggle = throttle ( toggle , CONST . TIMING . TEST_TOOLS_MODAL_THROTTLE_TIME ) ;
1917 throttledToggle ( ) ;
2018}
You can’t perform that action at this time.
0 commit comments