@@ -179,7 +179,7 @@ type NotificationActionGQL =
179
179
}
180
180
| {
181
181
__typename : 'AccountCreationAttempt' ;
182
- demand : IAccountCreationGQL ;
182
+ demand ? : IAccountCreationGQL ;
183
183
motivation : string ;
184
184
} ;
185
185
@@ -921,21 +921,21 @@ export const NotificationList = () => {
921
921
return translate ( 'notif.subscription.transfer.success' )
922
922
case 'AccountCreationAttempt' :
923
923
const description = translate ( 'notif.account.creation.attempt' ) ;
924
- const value = notification . action . demand . value
925
- const formStep = notification . action . demand . steps . map ( s => s . step ) . find ( s => s . type === 'form' )
924
+ const value = notification . action . demand ? .value
925
+ const formStep = notification . action . demand ? .steps . map ( s => s . step ) . find ( s => s . type === 'form' )
926
926
927
927
const regexp = / \[ \[ ( .+ ?) \] \] / g;
928
928
const matches = formStep ?. formatter . match ( regexp ) ;
929
929
930
930
const formattedValue = matches ?. reduce ( ( acc , match ) => {
931
931
const key = match . replace ( '[[' , '' ) . replace ( ']]' , '' ) ;
932
- return acc . replace ( match , value [ key ] || match ) ;
932
+ return acc . replace ( match , value ?. [ key ] || match ) ;
933
933
} , formStep ?. formatter ?? "" ) ;
934
934
935
935
return (
936
936
< >
937
937
{ description }
938
- < a
938
+ { value && < a
939
939
href = '#'
940
940
className = 'underline'
941
941
aria-label = { translate ( 'notifications.page.account.creation.attempt.detail.button.label' ) }
@@ -950,7 +950,7 @@ export const NotificationList = () => {
950
950
</ div >
951
951
} ) } >
952
952
< span className = 'ms-2' > [{ translate ( 'notifications.page.account.creation.attempt.detail.button.label' ) } ]</ span >
953
- </ a >
953
+ </ a > }
954
954
</ >
955
955
)
956
956
default :
0 commit comments