1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-06-16 13:46:16 +02:00

Fix lint.

This commit is contained in:
Bogdan Bodnar
2019-08-27 16:09:18 +02:00
parent 18e8e20206
commit c0d742b13b
36 changed files with 620 additions and 831 deletions

View File

@ -5,7 +5,9 @@
* See /LICENSE for more information.
*/
import { ForisUrls } from "forisUrls";
/* eslint no-console: "off" */
import { ForisURLs } from "forisUrls";
const PROTOCOL = window.location.protocol === "http:" ? "ws" : "wss";
@ -15,13 +17,13 @@ const URL = process.env.LIGHTTPD
const WAITING_FOR_CONNECTION_TIMEOUT = 500;
export class WebSockets {
export default class WebSockets {
constructor() {
this.ws = new WebSocket(URL);
this.ws.onerror = (e) => {
if (window.location.pathname !== ForisUrls.login) {
if (window.location.pathname !== ForisURLs.login) {
console.error("WS: Error observed, you aren't logged probably.");
window.location.replace(ForisUrls.login);
window.location.replace(ForisURLs.login);
}
console.log(`WS: Error: ${e}`);
};