Possible folders loading fix after clearing dialog
This commit is contained in:
parent
04679dadd2
commit
bee4efac90
@ -827,6 +827,12 @@ export class AppDialogsManager {
|
||||
};
|
||||
|
||||
dialogs.forEach((dialog) => {
|
||||
// :(
|
||||
const isBuggedDialog = !appMessagesManager.getDialogOnly(dialog.peerId);
|
||||
if(isBuggedDialog) {
|
||||
return;
|
||||
}
|
||||
|
||||
const element = this.sortedList.add(dialog.peerId, true, cccc, false);
|
||||
if(element.loadPromises) {
|
||||
loadPromises.push(...element.loadPromises);
|
||||
|
@ -595,13 +595,15 @@ export default class DialogsStorage {
|
||||
const foundDialog = this.getDialog(peerId, undefined, false);
|
||||
const [dialog, index] = foundDialog;
|
||||
if(dialog) {
|
||||
delete this.dialogs[peerId];
|
||||
|
||||
const folder = this.getFolder(dialog.folder_id);
|
||||
folder.dialogs.splice(index, 1);
|
||||
const wasPinned = indexOfAndSplice(this.pinnedOrders[dialog.folder_id], peerId) !== undefined;
|
||||
|
||||
this.processDialogForFilters(dialog);
|
||||
|
||||
const wasPinned = indexOfAndSplice(this.pinnedOrders[dialog.folder_id], peerId) !== undefined;
|
||||
this.dialogsIndex.indexObject(peerId, '');
|
||||
delete this.dialogs[peerId];
|
||||
|
||||
if(wasPinned) {
|
||||
this.savePinnedOrders();
|
||||
|
@ -128,6 +128,11 @@ export default class FiltersStorage {
|
||||
public testDialogForFilter(dialog: Dialog, filter: MyDialogFilter) {
|
||||
const peerId = dialog.peerId;
|
||||
|
||||
// * check whether dialog exists
|
||||
if(!this.appMessagesManager.getDialogOnly(peerId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// exclude_peers
|
||||
if(filter.excludePeerIds.includes(peerId)) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user