Fix chatlist reorder when unpinning old dialog

This commit is contained in:
Eduard Kuzmenko 2020-11-24 06:22:33 +02:00
parent acf836d078
commit 43cf1baa8a

View File

@ -915,6 +915,12 @@ export class AppDialogsManager {
} }
const needIndex = index - offset; const needIndex = index - offset;
if(needIndex > currentOrder.length) {
dom.listEl.remove();
delete this.doms[dialog.peerID];
return;
}
const peerIDByIndex = currentOrder[needIndex]; const peerIDByIndex = currentOrder[needIndex];
if(peerIDByIndex != dialog.peerID) { if(peerIDByIndex != dialog.peerID) {