Unwrap removeIdentityKey from calls to saveIdentity
saveIdentity is now reponsible for determining firstUse, so we must not remove the existing key before updating it. Previously, the implementation provided an extra check against overwritting an existing key, but that should be done via isTrustedIdentity instead. // FREEBIE
This commit is contained in:
@@ -293,12 +293,10 @@
|
||||
if (!oldpublicKey || equalArrayBuffers(oldpublicKey, publicKey)) {
|
||||
resolve(true);
|
||||
} else if (!storage.get('safety-numbers-approval', true)) {
|
||||
this.removeIdentityKey(identifier).then(function() {
|
||||
this.saveIdentity(identifier, publicKey).then(function() {
|
||||
console.log('Key changed for', identifier);
|
||||
this.trigger('keychange', identifier);
|
||||
resolve(true);
|
||||
}.bind(this));
|
||||
this.saveIdentity(identifier, publicKey).then(function() {
|
||||
console.log('Key changed for', identifier);
|
||||
this.trigger('keychange', identifier);
|
||||
resolve(true);
|
||||
}.bind(this));
|
||||
} else {
|
||||
resolve(false);
|
||||
|
Reference in New Issue
Block a user