enable back swarm polling when we get added back to a group

This commit is contained in:
Audric Ackermann 2020-10-05 10:53:09 +11:00
parent f031d1c357
commit 05e682cdc2
No known key found for this signature in database
GPG key ID: 999F434D76324AD4
2 changed files with 9 additions and 4 deletions

View file

@ -331,6 +331,8 @@ async function handleMediumGroupChange(
// Enable typing:
maybeConvo.set('isKickedFromGroup', false);
maybeConvo.set('left', false);
// Subscribe to this group id
window.SwarmPolling.addGroupId(new PubKey(groupId));
maybeConvo.updateTextInputState();
}
}
@ -342,8 +344,7 @@ async function handleMediumGroupChange(
const userSenderKey = await createSenderKeyForGroup(groupId, primary);
window.log.warn(
'Sharing our new senderKey with remainingMembers via message',
members,
userSenderKey
members
);
await shareSenderKeys(groupId, members, userSenderKey);

View file

@ -51,12 +51,16 @@ export class SwarmPolling {
}
public addGroupId(pubkey: PubKey) {
this.groupPubkeys.push(pubkey);
if (this.groupPubkeys.findIndex(m => m.key === pubkey.key) === -1) {
this.groupPubkeys.push(pubkey);
}
}
public addPubkey(pk: PubKey | string) {
const pubkey = PubKey.cast(pk);
this.pubkeys.push(pubkey);
if (this.pubkeys.findIndex(m => m.key === pubkey.key) === -1) {
this.pubkeys.push(pubkey);
}
}
public removePubkey(pk: PubKey | string) {