diff --git a/config.xml b/config.xml
index 8f99bd079..c69710433 100644
--- a/config.xml
+++ b/config.xml
@@ -114,7 +114,7 @@
-
+
diff --git a/src/addon/messages/messages.module.ts b/src/addon/messages/messages.module.ts
index 7eab2f334..5413893ae 100644
--- a/src/addon/messages/messages.module.ts
+++ b/src/addon/messages/messages.module.ts
@@ -102,7 +102,7 @@ export class AddonMessagesModule {
return;
}
- messagesProvider.invalidateDiscussionsCache().finally(() => {
+ messagesProvider.invalidateDiscussionsCache(notification.site).finally(() => {
linkHelper.goInSite(undefined, 'AddonMessagesIndexPage', undefined, notification.site);
});
});
diff --git a/src/addon/pushnotifications/providers/pushnotifications.ts b/src/addon/pushnotifications/providers/pushnotifications.ts
index 32b608c3f..348935a7f 100644
--- a/src/addon/pushnotifications/providers/pushnotifications.ts
+++ b/src/addon/pushnotifications/providers/pushnotifications.ts
@@ -344,9 +344,11 @@ export class AddonPushNotificationsProvider {
// Execute the callback in the Angular zone, so change detection doesn't stop working.
this.zone.run(() => {
this.pushID = data.registrationId;
- this.registerDeviceOnMoodle().catch((error) => {
- this.logger.warn('Can\'t register device', error);
- });
+ if (this.sitesProvider.isLoggedIn()) {
+ this.registerDeviceOnMoodle().catch((error) => {
+ this.logger.warn('Can\'t register device', error);
+ });
+ }
});
});
diff --git a/src/addon/pushnotifications/pushnotifications.module.ts b/src/addon/pushnotifications/pushnotifications.module.ts
index 257aae6eb..6de574ecc 100644
--- a/src/addon/pushnotifications/pushnotifications.module.ts
+++ b/src/addon/pushnotifications/pushnotifications.module.ts
@@ -70,7 +70,7 @@ export class AddonPushNotificationsModule {
// Listen for local notification clicks (generated by the app).
localNotificationsProvider.registerClick(AddonPushNotificationsProvider.COMPONENT,
- pushNotificationsProvider.notificationClicked);
+ pushNotificationsProvider.notificationClicked.bind(pushNotificationsProvider));
// Allow migrating the table from the old app to the new schema.
updateManager.registerAppTableMigration({