@@ -164,7 +164,6 @@ const SirenInbox = (props: SirenInboxProps): ReactElement => {
164164
165165 // Initialize Siren SDK and fetch notifications
166166 const initialize = async ( ) : Promise < void > => {
167-
168167 if ( siren ) {
169168 siren ?. stopRealTimeNotificationFetch ( ) ;
170169 const allNotifications = await fetchNotifications ( siren , true ) ;
@@ -173,7 +172,7 @@ const SirenInbox = (props: SirenInboxProps): ReactElement => {
173172 if ( isNonEmptyArray ( allNotifications ) )
174173 notificationParams . start = allNotifications [ 0 ] . createdAt ;
175174
176- if ( verificationStatus === VerificationStatus . SUCCESS )
175+ if ( verificationStatus === VerificationStatus . SUCCESS )
177176 siren ?. startRealTimeNotificationFetch ( notificationParams ) ;
178177 }
179178 } ;
@@ -223,7 +222,7 @@ const SirenInbox = (props: SirenInboxProps): ReactElement => {
223222 const response = await siren . fetchAllNotifications ( notificationParams ) ;
224223 const nonEmptyResponse = Boolean ( isNonEmptyArray ( response ?. data ) ) ;
225224
226- if ( response ?. data )
225+ if ( response ?. data )
227226 updatedNotifications = processResponse ( nonEmptyResponse , isResetList , response . data ) ;
228227 if ( response ?. error ) processError ( response . error ) ;
229228
@@ -262,8 +261,8 @@ const SirenInbox = (props: SirenInboxProps): ReactElement => {
262261
263262 if ( isNonEmptyArray ( allNotifications ) )
264263 notificationParams . start = allNotifications [ 0 ] . createdAt ;
265-
266- if ( verificationStatus === VerificationStatus . SUCCESS )
264+
265+ if ( verificationStatus === VerificationStatus . SUCCESS )
267266 siren ?. startRealTimeNotificationFetch ( notificationParams ) ;
268267 } catch ( err ) {
269268 setIsLoading ( false ) ;
@@ -350,8 +349,10 @@ const SirenInbox = (props: SirenInboxProps): ReactElement => {
350349 } ;
351350
352351 const renderHeader = ( ) : JSX . Element | null => {
353- if ( customHeader ) return customHeader ;
354- if ( ! hideHeader )
352+
353+ if ( ! hideHeader ) {
354+ if ( customHeader ) return customHeader ;
355+
355356 return (
356357 < Header
357358 title = { title }
@@ -361,6 +362,7 @@ const SirenInbox = (props: SirenInboxProps): ReactElement => {
361362 clearAllDisabled = { ! isNonEmptyArray ( notifications ) }
362363 />
363364 ) ;
365+ }
364366
365367 return null ;
366368 } ;
0 commit comments