@@ -12,11 +12,11 @@ import useLocalize from '@hooks/useLocalize';
1212import useThemeStyles from '@hooks/useThemeStyles' ;
1313import DateUtils from '@libs/DateUtils' ;
1414import DebugUtils from '@libs/DebugUtils' ;
15- import * as DeviceCapabilities from '@libs/DeviceCapabilities' ;
15+ import { canUseTouchScreen } from '@libs/DeviceCapabilities' ;
1616import Navigation from '@libs/Navigation/Navigation' ;
1717import type { PlatformStackScreenProps } from '@libs/Navigation/PlatformStackNavigation/types' ;
1818import type { DebugParamList } from '@libs/Navigation/types' ;
19- import * as NumberUtils from '@libs/NumberUtils' ;
19+ import { rand64 } from '@libs/NumberUtils' ;
2020import ReportActionItem from '@pages/home/report/ReportActionItem' ;
2121import Debug from '@userActions/Debug' ;
2222import CONST from '@src/CONST' ;
@@ -32,7 +32,7 @@ const getInitialReportAction = (reportID: string, session: OnyxEntry<Session>, p
3232 DebugUtils . stringifyJSON ( {
3333 actionName : CONST . REPORT . ACTIONS . TYPE . ADD_COMMENT ,
3434 reportID,
35- reportActionID : NumberUtils . rand64 ( ) ,
35+ reportActionID : rand64 ( ) ,
3636 created : DateUtils . getDBTime ( ) ,
3737 actorAccountID : session ?. accountID ,
3838 avatar : ( session ?. accountID && personalDetailsList ?. [ session . accountID ] ?. avatar ) ?? '' ,
@@ -46,8 +46,9 @@ function DebugReportActionCreatePage({
4646} : DebugReportActionCreatePageProps ) {
4747 const { translate} = useLocalize ( ) ;
4848 const styles = useThemeStyles ( ) ;
49- const [ session ] = useOnyx ( ONYXKEYS . SESSION ) ;
50- const [ personalDetailsList ] = useOnyx ( ONYXKEYS . PERSONAL_DETAILS_LIST ) ;
49+ const [ allReports ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT , { canBeMissing : false } ) ;
50+ const [ session ] = useOnyx ( ONYXKEYS . SESSION , { canBeMissing : false } ) ;
51+ const [ personalDetailsList ] = useOnyx ( ONYXKEYS . PERSONAL_DETAILS_LIST , { canBeMissing : false } ) ;
5152 const [ draftReportAction , setDraftReportAction ] = useState < string > ( ( ) => getInitialReportAction ( reportID , session , personalDetailsList ) ) ;
5253 const [ error , setError ] = useState < string > ( ) ;
5354
@@ -78,7 +79,7 @@ function DebugReportActionCreatePage({
7879 < ScreenWrapper
7980 includeSafeAreaPaddingBottom = { false }
8081 shouldEnableKeyboardAvoidingView = { false }
81- shouldEnableMinHeight = { DeviceCapabilities . canUseTouchScreen ( ) }
82+ shouldEnableMinHeight = { canUseTouchScreen ( ) }
8283 testID = { DebugReportActionCreatePage . displayName }
8384 >
8485 { ( { safeAreaPaddingBottomStyle} ) => (
@@ -105,6 +106,7 @@ function DebugReportActionCreatePage({
105106 < Text style = { [ styles . textLabelSupporting , styles . mb2 ] } > { translate ( 'debug.preview' ) } </ Text >
106107 { ! error ? (
107108 < ReportActionItem
109+ allReports = { allReports }
108110 action = { JSON . parse ( draftReportAction . replaceAll ( '\n' , '' ) ) as ReportAction }
109111 report = { { reportID} }
110112 reportActions = { [ ] }
0 commit comments