Fix going by broken contact

This commit is contained in:
morethanwords 2021-11-10 05:12:42 +04:00
parent 0474a7c959
commit 037a604eef

View File

@ -1247,6 +1247,10 @@ export class AppImManager {
} }
public setInnerPeer(peerId: PeerId, lastMsgId?: number, type: ChatType = 'chat', threadId?: number) { public setInnerPeer(peerId: PeerId, lastMsgId?: number, type: ChatType = 'chat', threadId?: number) {
if(peerId === NULL_PEER_ID || !peerId) {
return;
}
// * prevent opening already opened peer // * prevent opening already opened peer
const existingIndex = this.chats.findIndex(chat => chat.peerId === peerId && chat.type === type); const existingIndex = this.chats.findIndex(chat => chat.peerId === peerId && chat.type === type);
if(existingIndex !== -1) { if(existingIndex !== -1) {