[Glitch] Fixed ESLint error

Port 144e606ec9 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
th-downstream
abcang 4 years ago committed by Thibaut Girka
parent 11e0328fc7
commit b36187b56a

@ -345,7 +345,7 @@ export function setupBrowserNotifications() {
if ('Notification' in window && 'permissions' in navigator) { if ('Notification' in window && 'permissions' in navigator) {
navigator.permissions.query({ name: 'notifications' }).then((status) => { navigator.permissions.query({ name: 'notifications' }).then((status) => {
status.onchange = () => dispatch(setBrowserPermission(Notification.permission)); status.onchange = () => dispatch(setBrowserPermission(Notification.permission));
}); }).catch(console.warn);
} }
}; };
} }

@ -18,7 +18,9 @@ import { length } from 'stringz';
import { Tesseract as fetchTesseract } from 'flavours/glitch/util/async-components'; import { Tesseract as fetchTesseract } from 'flavours/glitch/util/async-components';
import GIFV from 'flavours/glitch/components/gifv'; import GIFV from 'flavours/glitch/components/gifv';
import { me } from 'flavours/glitch/util/initial_state'; import { me } from 'flavours/glitch/util/initial_state';
// eslint-disable-next-line import/no-extraneous-dependencies
import tesseractCorePath from 'tesseract.js-core/tesseract-core.wasm.js'; import tesseractCorePath from 'tesseract.js-core/tesseract-core.wasm.js';
// eslint-disable-next-line import/extensions
import tesseractWorkerPath from 'tesseract.js/dist/worker.min.js'; import tesseractWorkerPath from 'tesseract.js/dist/worker.min.js';
import { assetHost } from 'flavours/glitch/util/config'; import { assetHost } from 'flavours/glitch/util/config';

@ -3,6 +3,7 @@
const checkNotificationPromise = () => { const checkNotificationPromise = () => {
try { try {
// eslint-disable-next-line promise/catch-or-return
Notification.requestPermission().then(); Notification.requestPermission().then();
} catch(e) { } catch(e) {
return false; return false;
@ -22,7 +23,7 @@ const handlePermission = (permission, callback) => {
export const requestNotificationPermission = (callback) => { export const requestNotificationPermission = (callback) => {
if (checkNotificationPromise()) { if (checkNotificationPromise()) {
Notification.requestPermission().then((permission) => handlePermission(permission, callback)); Notification.requestPermission().then((permission) => handlePermission(permission, callback)).catch(console.warn);
} else { } else {
Notification.requestPermission((permission) => handlePermission(permission, callback)); Notification.requestPermission((permission) => handlePermission(permission, callback));
} }

@ -16,7 +16,7 @@ let sharedConnection;
* @property {function(): void} onDisconnect * @property {function(): void} onDisconnect
*/ */
/** /**
* @typedef StreamEvent * @typedef StreamEvent
* @property {string} event * @property {string} event
* @property {object} payload * @property {object} payload

Loading…
Cancel
Save