Browse Source

Fix new folder orderIndex

master
morethanwords 4 years ago
parent
commit
af9df0b22c
  1. 4
      src/components/sidebarLeft/tabs/chatFolders.ts
  2. 7
      src/lib/storages/filters.ts

4
src/components/sidebarLeft/tabs/chatFolders.ts

@ -62,7 +62,9 @@ export default class AppChatFoldersTab extends SliderSuperTab {
if(k) { if(k) {
d.push(i18n(k)); d.push(i18n(k));
} }
} else { }
if(!d.length) {
const folder = appMessagesManager.dialogsStorage.getFolder(filter.id); const folder = appMessagesManager.dialogsStorage.getFolder(filter.id);
let chats = 0, channels = 0, groups = 0; let chats = 0, channels = 0, groups = 0;
for(const dialog of folder) { for(const dialog of folder) {

7
src/lib/storages/filters.ts

@ -43,6 +43,13 @@ export default class FiltersStorage {
this.appStateManager.getState().then((state) => { this.appStateManager.getState().then((state) => {
this.filters = state.filters; this.filters = state.filters;
for(const filterId in this.filters) {
const filter = this.filters[filterId];
if(filter.hasOwnProperty('orderIndex') && filter.orderIndex >= this.orderIndex) {
this.orderIndex = filter.orderIndex + 1;
}
}
}); });
rootScope.addMultipleEventsListeners({ rootScope.addMultipleEventsListeners({

Loading…
Cancel
Save