mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
if we're not granted, show an ErrorDialog with some text which needs changing
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
0590ce7faf
commit
5e8b43f3ed
1 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,8 @@ import PlatformPeg from './PlatformPeg';
|
||||||
import TextForEvent from './TextForEvent';
|
import TextForEvent from './TextForEvent';
|
||||||
import Avatar from './Avatar';
|
import Avatar from './Avatar';
|
||||||
import dis from './dispatcher';
|
import dis from './dispatcher';
|
||||||
|
import sdk from './index';
|
||||||
|
import Modal from './Modal';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dispatches:
|
* Dispatches:
|
||||||
|
@ -131,6 +133,14 @@ const Notifier = {
|
||||||
plaf.requestNotificationPermission().done((result) => {
|
plaf.requestNotificationPermission().done((result) => {
|
||||||
if (result !== 'granted') {
|
if (result !== 'granted') {
|
||||||
// The permission request was dismissed or denied
|
// The permission request was dismissed or denied
|
||||||
|
const description = result === 'denied'
|
||||||
|
? 'Your browser is not permitting this app to send you notifications.'
|
||||||
|
: 'It seems you didn\'t accept notifications when your browser asked';
|
||||||
|
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
|
||||||
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
title: 'Unable to enable Notifications',
|
||||||
|
description,
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue