From 1eace97b1c1676379b7da372a64840556a4c1bbc Mon Sep 17 00:00:00 2001 From: morethanwords Date: Sun, 30 Aug 2020 15:28:54 +0300 Subject: [PATCH] Fix 'archiving works incorrect' --- src/lib/appManagers/appDialogsManager.ts | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/lib/appManagers/appDialogsManager.ts b/src/lib/appManagers/appDialogsManager.ts index 1b64a5b1..ea0d6b11 100644 --- a/src/lib/appManagers/appDialogsManager.ts +++ b/src/lib/appManagers/appDialogsManager.ts @@ -30,7 +30,7 @@ type DialogDom = { }; const testScroll = false; -const USEPINNEDDELIMITER = false; +//const USEPINNEDDELIMITER = false; class DialogsContextMenu { private element = document.getElementById('dialogs-contextmenu') as HTMLDivElement; @@ -321,11 +321,7 @@ export class AppDialogsManager { public _chatList = document.getElementById('dialogs') as HTMLUListElement; public chatList = this._chatList; - public pinnedDelimiter: HTMLDivElement; - /* public chatsHidden: Scrollable["hiddenElements"]; - public chatsVisible: Scrollable["visibleElements"]; - public chatsArchivedHidden: Scrollable["hiddenElements"]; - public chatsArchivedVisible: Scrollable["visibleElements"]; */ + //public pinnedDelimiter: HTMLDivElement; public doms: {[peerID: number]: DialogDom} = {}; public lastActiveListElement: HTMLElement = null; @@ -374,11 +370,11 @@ export class AppDialogsManager { this.allUnreadCount = this.folders.menu.querySelector('.unread-count'); - if(USEPINNEDDELIMITER) { + /* if(USEPINNEDDELIMITER) { this.pinnedDelimiter = document.createElement('div'); this.pinnedDelimiter.classList.add('pinned-delimiter'); this.pinnedDelimiter.appendChild(document.createElement('span')); - } + } */ this.folders.menuScrollContainer = this.folders.menu.parentElement; @@ -459,7 +455,7 @@ export class AppDialogsManager { this.setLastMessage(dialog); this.setDialogPosition(dialog); - this.setPinnedDelimiter(); + //this.setPinnedDelimiter(); this.setFiltersUnreadCount(); }); @@ -481,7 +477,7 @@ export class AppDialogsManager { this.updateDialog(dialog); } - this.setPinnedDelimiter(); + //this.setPinnedDelimiter(); this.validateForFilter(); this.setFiltersUnreadCount(); }); @@ -618,7 +614,7 @@ export class AppDialogsManager { return this.loadDialogs(this.filterID); }).then(result => { - this.setPinnedDelimiter(); + //this.setPinnedDelimiter(); //appSidebarLeft.onChatsScroll(); this.loadDialogs(1); }); @@ -671,7 +667,8 @@ export class AppDialogsManager { * Удалит неподходящие чаты из списка, но не добавит их(!) */ public validateForFilter() { - if(this.filterID == 0) return; + // !WARNING, возможно это было зачем-то, но комментарий исправил архивирование + //if(this.filterID == 0) return; const folder = appMessagesManager.dialogsStorage.getFolder(this.filterID); let affected = false; @@ -882,7 +879,7 @@ export class AppDialogsManager { this.log.debug('setDialogPosition:', dialog, dom, pos); } - public setPinnedDelimiter() { + /* public setPinnedDelimiter() { if(!USEPINNEDDELIMITER) return; let index = -1; @@ -916,7 +913,7 @@ export class AppDialogsManager { modifying.forEach(elem => { this.scroll.updateElement(elem); }); - } + } */ public setLastMessage(dialog: any, lastMessage?: any, dom?: DialogDom, highlightWord?: string) { if(!lastMessage) {