Fix lookupConversationWithoutServiceId

This commit is contained in:
Fedor Indutny 2024-03-04 10:14:31 -08:00 committed by GitHub
parent 78f4e96297
commit 4ccdb52d36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,12 +46,14 @@ type FoundUsernameType = {
export async function lookupConversationWithoutServiceId( export async function lookupConversationWithoutServiceId(
options: LookupConversationWithoutServiceIdOptionsType options: LookupConversationWithoutServiceIdOptionsType
): Promise<string | undefined> { ): Promise<string | undefined> {
if (options.type === 'username') {
const knownConversation = window.ConversationController.get( const knownConversation = window.ConversationController.get(
options.type === 'e164' ? options.e164 : options.username options.username
); );
if (knownConversation && knownConversation.getServiceId()) { if (knownConversation && knownConversation.getServiceId()) {
return knownConversation.id; return knownConversation.id;
} }
}
const identifier: UUIDFetchStateKeyType = const identifier: UUIDFetchStateKeyType =
options.type === 'e164' options.type === 'e164'