Add comments

This commit is contained in:
Andras Schmelczer 2025-03-30 12:24:08 +01:00
parent 86dead5266
commit 23ba0d2c82
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 11 additions and 0 deletions

View file

@ -266,6 +266,8 @@ export class Syncer {
wsUri.protocol = wsUri.protocol === "https" ? "wss" : "ws";
wsUri.pathname = `/vaults/${settings.vaultName}/ws`;
this.logger.info(`Connecting to WebSocket at ${wsUri.toString()}`);
if (
typeof globalThis !== "undefined" &&
typeof globalThis.WebSocket === "undefined"
@ -288,6 +290,7 @@ export class Syncer {
// The JS WebSocket API doesn't support setting headers, so we have to send the token as a message
this.applyRemoteChangesWebSocket.onopen = (): void => {
this.logger.info("WebSocket connection opened");
this.applyRemoteChangesWebSocket?.send(settings.token);
this.webSocketStatusChangeListeners.forEach((listener) => {
listener();