Merge branch 'message-sending-refactor-queue' into message-queue-test

pull/1177/head
Vincent 5 years ago
commit 14ca56581c

@ -1,4 +1,3 @@
import * as _ from 'lodash';
import { getPairedDevicesFor } from '../../../js/modules/data';
import { EventEmitter } from 'events';
@ -64,7 +63,10 @@ export class MessageQueue implements MessageQueueInterface {
);
await this.sendSyncMessage(message, ourDevices);
currentDevices = _.xor(currentDevices, ourDevices);
// Remove our devices from currentDevices
currentDevices = currentDevices.filter(device =>
ourDevices.some(d => PubKey.isEqual(d, device))
);
}
}

@ -27,7 +27,7 @@ export class PubKey {
return false;
}
public static isEqual(first: PubKey, second: PubKey) {
return first.key === second.key;
public static isEqual(key: PubKey, comparator: PubKey) {
return key.key === comparator.key;
}
}

Loading…
Cancel
Save