Skip to content

Commit

Permalink
Small changes based on code review
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed May 27, 2024
1 parent 12ffebd commit e9de732
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions web/src/client/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ class WSClient {
buildClient() {
const client = new WebSocket(this.url);
client.onopen = () => {
console.log("Connected websocket");
console.log("Websocket connected");
this.reconnectAttempts = 0;
if (this.timeout !== undefined) clearTimeout(this.timeout);
clearTimeout(this.timeout);

return this.dispatchOpenEvent();
};
Expand All @@ -98,7 +98,7 @@ class WSClient {
};

client.onclose = () => {
console.log(`Closed WebSocket`);
console.log(`WebSocket closed`);
this.dispatchCloseEvent();
this.timeout = setTimeout(() => this.connect(this.reconnectAttempts + 1), ATTEMPT_INTERVAL);
};
Expand Down
2 changes: 1 addition & 1 deletion web/src/context/installer.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { InstallerClientProvider, useInstallerClientStatus } from "./installer";

jest.mock("~/client");

let onDisconnectFn = jest.fn();
const onDisconnectFn = jest.fn();
const isConnectedFn = jest.fn();

// Helper component to check the client status.
Expand Down

0 comments on commit e9de732

Please sign in to comment.