You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +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:
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user