forked from External/greenlight
Require browser notification permissions only when the user signs in
The only notification right now is for signed in users that are viewing their room's page, so request permission only in this case.
This commit is contained in:
parent
bf7d087f45
commit
87bccb1204
|
@ -68,5 +68,10 @@ var showNotification = function(title, options) {
|
|||
}
|
||||
};
|
||||
|
||||
// TODO: only need permissions if the user is signed in
|
||||
Notification.requestPermission();
|
||||
// For now there are notifications only for users signed in and when they
|
||||
// are in their room's page
|
||||
$(document).on("turbolinks:load", function() {
|
||||
if (GreenLight.user.roomOwner) {
|
||||
Notification.requestPermission();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue