Don't delete all data if e164 changes (focus on UUID if we have it)
This commit is contained in:
parent
a918b06841
commit
13371fbeb7
1 changed files with 10 additions and 7 deletions
|
@ -538,20 +538,23 @@ export default class AccountManager extends EventTarget {
|
||||||
{ accessKey }
|
{ accessKey }
|
||||||
);
|
);
|
||||||
|
|
||||||
const numberChanged = previousNumber && previousNumber !== number;
|
|
||||||
const uuidChanged = previousUuid && uuid && previousUuid !== uuid;
|
const uuidChanged = previousUuid && uuid && previousUuid !== uuid;
|
||||||
|
|
||||||
if (numberChanged || uuidChanged) {
|
// We only consider the number changed if we didn't have a UUID before
|
||||||
if (numberChanged) {
|
const numberChanged =
|
||||||
window.log.warn(
|
!previousUuid && previousNumber && previousNumber !== number;
|
||||||
'New number is different from old number; deleting all previous data'
|
|
||||||
);
|
if (uuidChanged || numberChanged) {
|
||||||
}
|
|
||||||
if (uuidChanged) {
|
if (uuidChanged) {
|
||||||
window.log.warn(
|
window.log.warn(
|
||||||
'New uuid is different from old uuid; deleting all previous data'
|
'New uuid is different from old uuid; deleting all previous data'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (numberChanged) {
|
||||||
|
window.log.warn(
|
||||||
|
'New number is different from old number; deleting all previous data'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await window.textsecure.storage.protocol.removeAllData();
|
await window.textsecure.storage.protocol.removeAllData();
|
||||||
|
|
Loading…
Reference in a new issue