Correct chat id

This commit is contained in:
Franck Royer 2021-10-07 11:32:13 +11:00
parent 9d9723d137
commit aef476cc4d
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 5 additions and 5 deletions

View File

@ -76,20 +76,20 @@ export class Community {
}
let communityChat: CommunityChat | undefined;
let chatId: string | undefined;
let chatUuid: string | undefined;
this.description.chats.forEach((_chat, _id) => {
if (chatId) return;
if (chatUuid) return;
if (_chat.identity?.displayName === chatName) {
chatId = _id;
chatUuid = _id;
communityChat = _chat;
}
});
if (!communityChat || !chatId)
if (!communityChat || !chatUuid)
throw `Failed to retrieve community community chat with name ${chatName}`;
return Chat.create(chatId);
return Chat.create(this.publicKeyStr + chatUuid);
}
}