Merge pull request #3805 from tgxworld/avoid_constructing_desktop_notifications_on_mobile

FIX: Don't subscribe to Desktop Notifications on mobile.
This commit is contained in:
Régis Hanol 2015-09-23 10:29:32 +02:00
commit 864607e01f
1 changed files with 7 additions and 5 deletions

View File

@ -29,10 +29,6 @@ export default {
});
}
bus.subscribe("/notification-alert/" + user.get('id'), function(data){
onNotification(data, user);
});
bus.subscribe("/notification/" + user.get('id'), function(data) {
const oldUnread = user.get('unread_notifications');
const oldPM = user.get('unread_private_messages');
@ -85,7 +81,13 @@ export default {
});
if (!Ember.testing) {
initDesktopNotifications(bus);
if (!Discourse.Mobile.mobileView) {
bus.subscribe("/notification-alert/" + user.get('id'), function(data){
onNotification(data, user);
});
initDesktopNotifications(bus);
}
}
}
}