@@ -18,8 +18,8 @@ function SMSDeliveryFailurePage() {
1818 const styles = useThemeStyles ( ) ;
1919 const { isKeyboardShown} = useKeyboardState ( ) ;
2020 const { translate} = useLocalize ( ) ;
21- const [ credentials ] = useOnyx ( ONYXKEYS . CREDENTIALS ) ;
22- const [ account ] = useOnyx ( ONYXKEYS . ACCOUNT ) ;
21+ const [ credentials ] = useOnyx ( ONYXKEYS . CREDENTIALS , { canBeMissing : true } ) ;
22+ const [ account ] = useOnyx ( ONYXKEYS . ACCOUNT , { canBeMissing : true } ) ;
2323
2424 const login = useMemo ( ( ) => {
2525 if ( ! credentials ?. login ) {
@@ -40,7 +40,14 @@ function SMSDeliveryFailurePage() {
4040 if ( ! SMSDeliveryFailureMessage ) {
4141 return null ;
4242 }
43- return JSON . parse ( SMSDeliveryFailureMessage ) as TimeData ;
43+
44+ const parsedData = JSON . parse ( SMSDeliveryFailureMessage ) as TimeData | [ ] ;
45+
46+ if ( Array . isArray ( parsedData ) && ! parsedData . length ) {
47+ return null ;
48+ }
49+
50+ return parsedData as TimeData ;
4451 } , [ SMSDeliveryFailureMessage ] ) ;
4552
4653 const hasSMSDeliveryFailure = account ?. smsDeliveryFailureStatus ?. hasSMSDeliveryFailure ;
@@ -63,7 +70,7 @@ function SMSDeliveryFailurePage() {
6370 < >
6471 < View style = { [ styles . mv3 , styles . flexRow ] } >
6572 < View style = { [ styles . flex1 ] } >
66- < Text > { timeData && translate ( 'smsDeliveryFailurePage.validationFailed' , { timeData} ) } </ Text >
73+ < Text > { translate ( 'smsDeliveryFailurePage.validationFailed' , { timeData} ) } </ Text >
6774 </ View >
6875 </ View >
6976 < View style = { [ styles . mv4 , styles . flexRow , styles . justifyContentBetween , styles . alignItemsEnd ] } >
0 commit comments