mirror of
https://github.com/Blah-IM/Weblah.git
synced 2025-05-01 00:31:08 +00:00
fix: check null encodedKeyPair in onKeyPairChange
This commit is contained in:
parent
82f0fc35b0
commit
5a7641b4d6
1 changed files with 2 additions and 2 deletions
|
@ -52,8 +52,8 @@ class ChatServerConnectionPool {
|
||||||
this.connections.clear();
|
this.connections.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async onKeyPairChange(encodedKeyPair: EncodedBlahKeyPair) {
|
private async onKeyPairChange(encodedKeyPair: EncodedBlahKeyPair | null) {
|
||||||
this.keypair = await BlahKeyPair.fromEncoded(encodedKeyPair);
|
this.keypair = encodedKeyPair ? await BlahKeyPair.fromEncoded(encodedKeyPair) : null;
|
||||||
for (const connection of this.connections.values()) {
|
for (const connection of this.connections.values()) {
|
||||||
connection.changeKeyPair(this.keypair);
|
connection.changeKeyPair(this.keypair);
|
||||||
connection.connect();
|
connection.connect();
|
||||||
|
|
Loading…
Add table
Reference in a new issue