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