Fixup refreshPreKeys and call it whenever a prekey is deleted
This commit is contained in:
parent
7d0aeac8cb
commit
45a61780af
3 changed files with 8 additions and 2 deletions
|
@ -123,6 +123,12 @@
|
|||
},
|
||||
removePreKey: function(keyId) {
|
||||
var prekey = new PreKey({id: keyId});
|
||||
|
||||
new Promise(function(resolve) {
|
||||
var accountManager = new textsecure.AccountManager();
|
||||
accountManager.refreshPreKeys().then(resolve);
|
||||
});
|
||||
|
||||
return new Promise(function(resolve) {
|
||||
prekey.destroy().then(function() {
|
||||
resolve();
|
||||
|
|
|
@ -39443,7 +39443,7 @@ window.textsecure.api = function () {
|
|||
refreshPreKeys: function() {
|
||||
return textsecure.api.getMyKeys().then(function(preKeyCount) {
|
||||
if (preKeyCount < 10) {
|
||||
return generateKeys(100);
|
||||
return generateKeys(100).then(TextSecureServer.registerKeys);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
refreshPreKeys: function() {
|
||||
return textsecure.api.getMyKeys().then(function(preKeyCount) {
|
||||
if (preKeyCount < 10) {
|
||||
return generateKeys(100);
|
||||
return generateKeys(100).then(TextSecureServer.registerKeys);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue