Error toast on computeSecret error.
This commit is contained in:
parent
7e41fe73e7
commit
c10310af3a
|
@ -201,11 +201,15 @@ export default new class E2EE extends BuiltinModule {
|
|||
}
|
||||
|
||||
computeSecret(userID, otherKey) {
|
||||
try {
|
||||
const secret = this.ecdh[userID].computeSecret(otherKey, 'base64', 'base64');
|
||||
delete this.ecdh[userID];
|
||||
const hash = crypto.createHash('sha256');
|
||||
hash.update(secret);
|
||||
return hash.digest('base64');
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
handleChannelTextAreaSubmit(component, args, retVal) {
|
||||
|
|
|
@ -60,7 +60,8 @@
|
|||
chatInput[Object.keys(chatInput).find(k => k.startsWith('__reactEventHandlers'))].onChange.call(chatInput, evt);
|
||||
Toasts.success("Encryption key has been set for this DM channel.");
|
||||
} catch (e) {
|
||||
throw e;
|
||||
Toasts.error("Invalid public key. Please set up a new key exchange.");
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue