Ignore empty e164 in storage service
This commit is contained in:
parent
9db8765b6c
commit
cc5da98565
2 changed files with 16 additions and 2 deletions
|
@ -1267,9 +1267,14 @@ export async function startApp(): Promise<void> {
|
||||||
const newDeviceId = window.textsecure.storage.user.getDeviceId();
|
const newDeviceId = window.textsecure.storage.user.getDeviceId();
|
||||||
const newNumber = window.textsecure.storage.user.getNumber();
|
const newNumber = window.textsecure.storage.user.getNumber();
|
||||||
const newUuid = window.textsecure.storage.user.getUuid();
|
const newUuid = window.textsecure.storage.user.getUuid();
|
||||||
|
const ourConversation = window.ConversationController.getOurConversation();
|
||||||
|
|
||||||
|
if (ourConversation?.get('e164') !== newNumber) {
|
||||||
|
ourConversation?.set('e164', newNumber);
|
||||||
|
}
|
||||||
|
|
||||||
window.reduxActions.user.userChanged({
|
window.reduxActions.user.userChanged({
|
||||||
ourConversationId: window.ConversationController.getOurConversationId(),
|
ourConversationId: ourConversation?.get('id'),
|
||||||
ourDeviceId: newDeviceId,
|
ourDeviceId: newDeviceId,
|
||||||
ourNumber: newNumber,
|
ourNumber: newNumber,
|
||||||
ourUuid: newUuid,
|
ourUuid: newUuid,
|
||||||
|
@ -1879,6 +1884,15 @@ export async function startApp(): Promise<void> {
|
||||||
|
|
||||||
window.Signal.challengeHandler = challengeHandler;
|
window.Signal.challengeHandler = challengeHandler;
|
||||||
|
|
||||||
|
if (!window.storage.user.getNumber()) {
|
||||||
|
const ourConversation = window.ConversationController.getOurConversation();
|
||||||
|
const ourE164 = ourConversation?.get('e164');
|
||||||
|
if (ourE164) {
|
||||||
|
window.log.warn('Restoring E164 from our conversation');
|
||||||
|
window.storage.user.setNumber(ourE164);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
window.dispatchEvent(new Event('storage_ready'));
|
window.dispatchEvent(new Event('storage_ready'));
|
||||||
|
|
||||||
window.log.info('Expiration start timestamp cleanup: starting...');
|
window.log.info('Expiration start timestamp cleanup: starting...');
|
||||||
|
|
|
@ -854,7 +854,7 @@ export async function mergeAccountRecord(
|
||||||
window.storage.put('primarySendsSms', primarySendsSms);
|
window.storage.put('primarySendsSms', primarySendsSms);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof accountE164 === 'string') {
|
if (typeof accountE164 === 'string' && accountE164) {
|
||||||
window.storage.put('accountE164', accountE164);
|
window.storage.put('accountE164', accountE164);
|
||||||
window.storage.user.setNumber(accountE164);
|
window.storage.user.setNumber(accountE164);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue