File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -449,15 +449,7 @@ function OneSignalLogin () {
449449 // Register handler for processing data received via web-push
450450 OneSignal . Notifications . addEventListener ( "foregroundWillDisplay" , ( notification ) => {
451451 const payload = notification . notification . additionalData ; // Access web-pushed data
452- if ( payload . webhook ) return ; // Ignore web-pushed data if webhook already received the data
453- if ( 'data' in payload ) {
454- logThis ( `Received via web-push: ${ JSON . stringify ( payload . data ) } ` ) ;
455- inbox ( [ payload . data ] ) ;
456- // If autoSync is on, still webhook didnt receive, then sync() to re-register webhook with Securelay.
457- if ( cache . getItem ( 'autoSync' ) === 'on' ) sync ( ) ;
458- } else {
459- sync ( ) ;
460- }
452+ if ( ! messagesReceived . includes ( payload . id ) ) sync ( ) ; // Message not already received
461453 } ) ;
462454 } ) ;
463455}
You can’t perform that action at this time.
0 commit comments