mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
Fix condition in getE164
This commit is contained in:
@@ -247,12 +247,6 @@ export function createIPCEvents(
|
||||
setPhoneNumberSharingSetting: async (newValue: PhoneNumberSharingMode) => {
|
||||
const account = window.ConversationController.getOurConversationOrThrow();
|
||||
|
||||
// writeProfile fetches the latest profile first so do it before updating
|
||||
// local data to prevent triggering a conflict.
|
||||
await writeProfile(getConversation(account), {
|
||||
keepAvatar: true,
|
||||
});
|
||||
|
||||
const promises = new Array<Promise<void>>();
|
||||
promises.push(window.storage.put('phoneNumberSharingMode', newValue));
|
||||
if (newValue === PhoneNumberSharingMode.Everybody) {
|
||||
@@ -264,6 +258,12 @@ export function createIPCEvents(
|
||||
}
|
||||
account.captureChange('phoneNumberSharingMode');
|
||||
await Promise.all(promises);
|
||||
|
||||
// Write profile after updating storage so that the write has up-to-date
|
||||
// information.
|
||||
await writeProfile(getConversation(account), {
|
||||
keepAvatar: true,
|
||||
});
|
||||
},
|
||||
|
||||
getHasStoriesDisabled: () =>
|
||||
|
||||
@@ -14,11 +14,12 @@ export function getE164(
|
||||
| 'systemFamilyName'
|
||||
| 'e164'
|
||||
| 'notSharingPhoneNumber'
|
||||
| 'profileKey'
|
||||
>
|
||||
): string | undefined {
|
||||
const { e164, notSharingPhoneNumber = false } = attributes;
|
||||
const { e164, profileKey, notSharingPhoneNumber = false } = attributes;
|
||||
|
||||
if (notSharingPhoneNumber && !isInSystemContacts(attributes)) {
|
||||
if (notSharingPhoneNumber && profileKey && !isInSystemContacts(attributes)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ export function getSystemName(
|
||||
export function getNumber(
|
||||
attributes: Pick<
|
||||
ConversationAttributesType,
|
||||
'e164' | 'type' | 'notSharingPhoneNumber'
|
||||
'e164' | 'type' | 'notSharingPhoneNumber' | 'profileKey'
|
||||
>
|
||||
): string | undefined {
|
||||
if (!isDirectConversation(attributes)) {
|
||||
|
||||
Reference in New Issue
Block a user