diff --git a/libtextsecure/account_manager.js b/libtextsecure/account_manager.js index 8452e3934..14559d1cd 100644 --- a/libtextsecure/account_manager.js +++ b/libtextsecure/account_manager.js @@ -444,12 +444,18 @@ window.log.info('clearing all sessions, prekeys, and signed prekeys'); await Promise.all([ - store.clearPreKeyStore(), store.clearContactPreKeysStore(), - store.clearSignedPreKeysStore(), store.clearContactSignedPreKeysStore(), store.clearSessionStore(), ]); + // During secondary device registration we need to keep our prekeys sent + // to other pubkeys + if (textsecure.storage.get('secondaryDeviceStatus') !== 'ongoing') { + await Promise.all([ + store.clearPreKeyStore(), + store.clearSignedPreKeysStore(), + ]); + } }, // Takes the same object returned by generateKeys async confirmKeys(keys) {