add small timeout before asking for notification permission

This commit is contained in:
Matteo Pagliazzi
2016-09-09 21:26:40 +02:00
parent f6c765b7b5
commit 60f7a1dbd9

View File

@@ -26,7 +26,9 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
checkForNotifications(); checkForNotifications();
if ($state.is('options.social.party')) { if ($state.is('options.social.party')) {
if ('Notification' in window && window.Notification.permission === 'default') { if ('Notification' in window && window.Notification.permission === 'default') {
window.Notification.requestPermission(); setTimeout(function () {
window.Notification.requestPermission();
}, 100);
} }
Chat.markChatSeen($scope.group._id); Chat.markChatSeen($scope.group._id);
} }