Ensure primaryDevicePubKey is always defined in storage

pull/633/head
sachaaaaa 6 years ago
parent 8b6047a3ae
commit 0b41ef0983

@ -305,6 +305,13 @@
storage.put('PoWDifficulty', window.getDefaultPoWDifficulty());
}
// Ensure accounts created prior to 1.0.0-beta8 do have their
// 'primaryDevicePubKey' defined.
const primaryDevicePubKey = storage.get('primaryDevicePubKey', null);
if (!primaryDevicePubKey) {
storage.put('primaryDevicePubKey', textsecure.storage.user.getNumber());
}
// These make key operations available to IPC handlers created in preload.js
window.Events = {
getDeviceName: () => textsecure.storage.user.getDeviceName(),

Loading…
Cancel
Save