mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Cleanup checkbox component
This commit is contained in:
parent
081761b593
commit
01d96153c6
6 changed files with 11 additions and 20 deletions
|
|
@ -41,13 +41,13 @@ export const NotificationUserStore = new class {
|
|||
|
||||
this.enableDesktopNotification = ko.observable(false)/*.extend({ notify: 'always' })*/;
|
||||
|
||||
this.isDesktopNotificationDenied = ko.observable(NotificationsDenied());
|
||||
this.isDesktopNotificationAllowed = ko.observable(!NotificationsDenied());
|
||||
|
||||
this.enableDesktopNotification.subscribe(value => {
|
||||
DesktopNotifications = !!value;
|
||||
if (value && HTML5Notification && !NotificationsGranted()) {
|
||||
HTML5Notification.requestPermission(() =>
|
||||
this.isDesktopNotificationDenied(NotificationsDenied())
|
||||
this.isDesktopNotificationAllowed(!NotificationsDenied())
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue