From 114f6d083f1a2d1def207e4baf036d57c64bd6b8 Mon Sep 17 00:00:00 2001 From: Maxim Shishmarev Date: Thu, 2 Jul 2020 15:42:36 +1000 Subject: [PATCH] Fix pubkey comparison --- ts/session/snode_api/swarmPolling.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ts/session/snode_api/swarmPolling.ts b/ts/session/snode_api/swarmPolling.ts index 1af47b01f..13683f0f0 100644 --- a/ts/session/snode_api/swarmPolling.ts +++ b/ts/session/snode_api/swarmPolling.ts @@ -36,8 +36,8 @@ export function processMessage(message: string, options: any = {}) { } export class SwarmPolling { - private readonly pubkeys: Array; - private readonly groupPubkeys: Array; + private pubkeys: Array; + private groupPubkeys: Array; private readonly lastHashes: { [key: string]: PubkeyToHash }; constructor() { @@ -61,11 +61,8 @@ export class SwarmPolling { } public removePubkey(pubkey: PubKey) { - if (this.pubkeys.indexOf(pubkey) !== -1) { - _.remove(this.pubkeys, pubkey); - } else if (this.groupPubkeys.indexOf(pubkey) !== -1) { - _.remove(this.groupPubkeys, pubkey); - } + this.pubkeys = this.pubkeys.filter(key => !pubkey.isEqual(key)); + this.groupPubkeys = this.groupPubkeys.filter(key => !pubkey.isEqual(key)); } private loadGroupIds() {