File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
addon/notifications/providers Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ export class AddonNotificationsPushClickHandler implements CorePushNotifications
3939 * @return Whether the notification click is handled by this handler
4040 */
4141 handles ( notification : any ) : boolean | Promise < boolean > {
42+ if ( ! notification . moodlecomponent ) {
43+ // The notification doesn't come from Moodle. Handle it.
44+ return true ;
45+ }
46+
4247 if ( this . utils . isTrueOrOne ( notification . notif ) ) {
4348 // Notification clicked, mark as read. Don't block for this.
4449 const notifId = notification . savedmessageid || notification . id ;
@@ -74,7 +79,7 @@ export class AddonNotificationsPushClickHandler implements CorePushNotifications
7479 // Try to handle the appurl.
7580 if ( notification . customdata && notification . customdata . appurl ) {
7681 switch ( notification . customdata . appurlopenin ) {
77- case 'inappbrowser ' :
82+ case 'inapp ' :
7883 this . utils . openInApp ( notification . customdata . appurl ) ;
7984
8085 return ;
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ export class CoreCoursesEnrolPushClickHandler implements CorePushNotificationsCl
3737 * @return Whether the notification click is handled by this handler
3838 */
3939 handles ( notification : any ) : boolean | Promise < boolean > {
40- return this . utils . isTrueOrOne ( notification . notif ) && notification . moodlecomponent . indexOf ( 'enrol_' ) === 0 &&
41- notification . name == 'expiry_notification' ;
40+ return this . utils . isTrueOrOne ( notification . notif ) && notification . moodlecomponent &&
41+ notification . moodlecomponent . indexOf ( 'enrol_' ) === 0 && notification . name == 'expiry_notification' ;
4242 }
4343
4444 /**
You can’t perform that action at this time.
0 commit comments