[Glitch] Fixed ESLint error
Port a2da02626e
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
const checkNotificationPromise = () => {
|
||||
try {
|
||||
// eslint-disable-next-line promise/catch-or-return
|
||||
Notification.requestPermission().then();
|
||||
} catch(e) {
|
||||
return false;
|
||||
@ -22,7 +23,7 @@ const handlePermission = (permission, callback) => {
|
||||
|
||||
export const requestNotificationPermission = (callback) => {
|
||||
if (checkNotificationPromise()) {
|
||||
Notification.requestPermission().then((permission) => handlePermission(permission, callback));
|
||||
Notification.requestPermission().then((permission) => handlePermission(permission, callback)).catch(console.warn);
|
||||
} else {
|
||||
Notification.requestPermission((permission) => handlePermission(permission, callback));
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ let sharedConnection;
|
||||
* @property {function(): void} onDisconnect
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* @typedef StreamEvent
|
||||
* @property {string} event
|
||||
* @property {object} payload
|
||||
|
Reference in New Issue
Block a user