Change Phone Number notifications

This commit is contained in:
Fedor Indutny 2021-08-05 16:34:49 -07:00 committed by GitHub
parent 4b82ac387b
commit a001882d58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 277 additions and 39 deletions

View file

@ -186,6 +186,11 @@ export async function toAccountRecord(
accountRecord.primarySendsSms = Boolean(primarySendsSms);
}
const accountE164 = window.storage.get('accountE164');
if (accountE164 !== undefined) {
accountRecord.e164 = accountE164;
}
const universalExpireTimer = getUniversalExpireTimer();
if (universalExpireTimer) {
accountRecord.universalExpireTimer = Number(universalExpireTimer);
@ -828,6 +833,7 @@ export async function mergeAccountRecord(
typingIndicators,
primarySendsSms,
universalExpireTimer,
e164: accountE164,
} = accountRecord;
window.storage.put('read-receipt-setting', Boolean(readReceipts));
@ -848,6 +854,11 @@ export async function mergeAccountRecord(
window.storage.put('primarySendsSms', primarySendsSms);
}
if (typeof accountE164 === 'string') {
window.storage.put('accountE164', accountE164);
window.storage.user.setNumber(accountE164);
}
setUniversalExpireTimer(universalExpireTimer || 0);
const PHONE_NUMBER_SHARING_MODE_ENUM =