Skip to content

Commit

Permalink
Merge pull request #97 from MennoVS/master
Browse files Browse the repository at this point in the history
fix Notification.close on PushNotifications
  • Loading branch information
flauc authored Nov 1, 2016
2 parents 247350a + 26f7d7a commit f65f336
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/push-notifications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export class PushNotificationsService {
return new Observable((obs: any) => {

if (!('Notification' in window)) {
obs.error('Notifications are not available in this envirement');
obs.error('Notifications are not available in this environment');
obs.complete();
}

if (this.permission !== 'granted') {
obs.error(`The user didn't granted you permission to send push notifications`);
obs.error(`The user hasn't granted you permission to send push notifications`);
obs.complete();
}

Expand All @@ -42,10 +42,6 @@ export class PushNotificationsService {
n.onclick = (e: any) => obs.next({notification: n, event: e});
n.onerror = (e: any) => obs.error({notification: n, event: e});
n.onclose = () => obs.complete();
n.close = () => {
n.close.bind(n);
obs.complete();
};
});
}

Expand Down

0 comments on commit f65f336

Please sign in to comment.