Skip to content

Commit 019f30e

Browse files
committed
fix: websocket linting errors.
1 parent 28a3e2b commit 019f30e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/websocket.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,17 @@ const RETRY_TIMEOUT = 5000;
66
const wsUri = window.localStorage.getItem(LOCALSTORAGE_WS_URI) || 'ws://localhost:8080/ws';
77

88
const websocket = {
9-
conn: null,
9+
conn: null as null | WebSocket,
1010
connect() {
1111
const ws = new WebSocket(wsUri);
12-
ws.onopen = (event) => {
12+
ws.onopen = () => {
1313
console.info('[ffmpeg-commander] - websocket connection detected.');
14-
console.log(event);
15-
const { target } = event;
16-
const isReady = target && target.readyState === WebSocket.OPEN;
17-
store.setWSAction(isReady);
14+
store.setWSAction(ws.readyState === WebSocket.OPEN);
1815
};
1916

20-
ws.onclose = (event) => {
17+
ws.onclose = () => {
2118
console.info('[ffmpeg-commander] - websocket connection closed.');
22-
const isReady = event.target.readyState === WebSocket.OPEN;
23-
store.setWSAction(isReady);
19+
store.setWSAction(ws.readyState === WebSocket.OPEN);
2420
ws.close();
2521

2622
setTimeout(() => {

0 commit comments

Comments
 (0)