From eeb9f3ef7e3a6a7dbbcbcbbcb36b6343056cf9ff Mon Sep 17 00:00:00 2001 From: niekcandaele Date: Sun, 20 Jun 2021 13:12:00 +0200 Subject: [PATCH 1/3] fix: compare instead of assignment --- client/javascript/src/spv-channels.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/javascript/src/spv-channels.ts b/client/javascript/src/spv-channels.ts index ed2a851..31028e3 100644 --- a/client/javascript/src/spv-channels.ts +++ b/client/javascript/src/spv-channels.ts @@ -172,7 +172,7 @@ export class ChannelsClient if (resp.status != 200) throw new Error(`Error calling SPV channels API. Invalid status code received: ${resp.status.toString()}`); - if (resp.data.length = 1) + if (resp.data.length === 1) return resp.data[0]; return null; From 0745ab35cb090561c93a8671b60502821679b9b6 Mon Sep 17 00:00:00 2001 From: niekcandaele Date: Sun, 20 Jun 2021 13:12:21 +0200 Subject: [PATCH 2/3] types: getToken can return null --- client/javascript/src/spv-channels.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/javascript/src/spv-channels.ts b/client/javascript/src/spv-channels.ts index 31028e3..039a118 100644 --- a/client/javascript/src/spv-channels.ts +++ b/client/javascript/src/spv-channels.ts @@ -163,7 +163,7 @@ export class ChannelsClient * @param token Token string. * @returns Token details. */ - async getToken(channel: Channel, token: string): Promise + async getToken(channel: Channel, token: string): Promise { console.debug(`Calling listTokens to ${this.getServiceUrl()} for channel with id ${channel.id} using username ${this._username}`); From 90d822438258c37e9ff354ec0fd627e6eac19792 Mon Sep 17 00:00:00 2001 From: niekcandaele Date: Sun, 20 Jun 2021 16:26:31 +0200 Subject: [PATCH 3/3] docs: fix a typo --- client/javascript/src/spv-channels.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/javascript/src/spv-channels.ts b/client/javascript/src/spv-channels.ts index 039a118..4263dc6 100644 --- a/client/javascript/src/spv-channels.ts +++ b/client/javascript/src/spv-channels.ts @@ -470,7 +470,7 @@ export class MessagingClient /** * Check that notifications are active. * - * @returns True if notifications wesocket is open. + * @returns True if notifications websocket is open. */ public notificationsActive() : boolean {