mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-07-31 19:53:28 +02:00
Fix linting issues
This commit is contained in:
@@ -10,14 +10,12 @@
|
||||
const PROTOCOL = window.location.protocol === "http:" ? "ws" : "wss";
|
||||
|
||||
const URL = process.env.LIGHTTPD
|
||||
? `${PROTOCOL}://${window.location.host}/${
|
||||
process.env.WSPATH || "foris-ws"
|
||||
}`
|
||||
? `${PROTOCOL}://${window.location.host}/${process.env.WSPATH || "foris-ws"}`
|
||||
: `${PROTOCOL}://${window.location.hostname}:9081`;
|
||||
|
||||
const WAITING_FOR_CONNECTION_TIMEOUT = 500;
|
||||
|
||||
export class WebSockets {
|
||||
class WebSockets {
|
||||
constructor() {
|
||||
this.ws = new WebSocket(URL);
|
||||
this.ws.onerror = (e) => {
|
||||
@@ -122,3 +120,5 @@ export class WebSockets {
|
||||
this.ws.close();
|
||||
}
|
||||
}
|
||||
|
||||
export default WebSockets;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
|
||||
* Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
||||
*
|
||||
* This is free software, licensed under the GNU General Public License v3.
|
||||
* See /LICENSE for more information.
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function useWSForisModule(
|
||||
/* eslint-disable default-param-last */
|
||||
function useWSForisModule(
|
||||
ws,
|
||||
module,
|
||||
action = "update_settings",
|
||||
@@ -41,3 +42,5 @@ export function useWSForisModule(
|
||||
|
||||
return [data];
|
||||
}
|
||||
|
||||
export default useWSForisModule;
|
||||
|
Reference in New Issue
Block a user