Handle resize to change 'All Chats' to 'All'
This commit is contained in:
parent
3a31b69f3e
commit
539d3ad57b
@ -58,6 +58,7 @@ import { NULL_PEER_ID } from "../mtproto/mtproto_config";
|
|||||||
import groupCallActiveIcon from "../../components/groupCallActiveIcon";
|
import groupCallActiveIcon from "../../components/groupCallActiveIcon";
|
||||||
import { Chat } from "../../layer";
|
import { Chat } from "../../layer";
|
||||||
import IS_GROUP_CALL_SUPPORTED from "../../environment/groupCallSupport";
|
import IS_GROUP_CALL_SUPPORTED from "../../environment/groupCallSupport";
|
||||||
|
import mediaSizes from "../../helpers/mediaSizes";
|
||||||
|
|
||||||
export type DialogDom = {
|
export type DialogDom = {
|
||||||
avatarEl: AvatarElement,
|
avatarEl: AvatarElement,
|
||||||
@ -329,6 +330,10 @@ export class AppDialogsManager {
|
|||||||
});
|
});
|
||||||
}) */;
|
}) */;
|
||||||
|
|
||||||
|
mediaSizes.addEventListener('resize', () => {
|
||||||
|
this.changeFiltersAllChatsKey();
|
||||||
|
});
|
||||||
|
|
||||||
new ConnectionStatusComponent(this.chatsContainer);
|
new ConnectionStatusComponent(this.chatsContainer);
|
||||||
this.chatsContainer.append(bottomPart);
|
this.chatsContainer.append(bottomPart);
|
||||||
|
|
||||||
@ -779,6 +784,15 @@ export class AppDialogsManager {
|
|||||||
this.onFiltersLengthChange();
|
this.onFiltersLengthChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private changeFiltersAllChatsKey() {
|
||||||
|
const scrollable = this.folders.menuScrollContainer.firstElementChild;
|
||||||
|
const key: LangPackKey = scrollable.scrollWidth > scrollable.clientWidth ? 'FilterAllChatsShort' : 'FilterAllChats';
|
||||||
|
if(this.allChatsIntlElement.key !== key) {
|
||||||
|
this.allChatsIntlElement.key = key;
|
||||||
|
this.allChatsIntlElement.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private onFiltersLengthChange() {
|
private onFiltersLengthChange() {
|
||||||
if(!this.showFiltersPromise) {
|
if(!this.showFiltersPromise) {
|
||||||
this.showFiltersPromise = new Promise<void>((resolve) => {
|
this.showFiltersPromise = new Promise<void>((resolve) => {
|
||||||
@ -796,12 +810,7 @@ export class AppDialogsManager {
|
|||||||
this.chatsContainer.classList.toggle('has-filters', show);
|
this.chatsContainer.classList.toggle('has-filters', show);
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrollable = this.folders.menuScrollContainer.firstElementChild;
|
this.changeFiltersAllChatsKey();
|
||||||
const key: LangPackKey = scrollable.scrollWidth > scrollable.clientWidth ? 'FilterAllChatsShort' : 'FilterAllChats';
|
|
||||||
if(this.allChatsIntlElement.key !== key) {
|
|
||||||
this.allChatsIntlElement.key = key;
|
|
||||||
this.allChatsIntlElement.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.showFiltersPromise = undefined;
|
this.showFiltersPromise = undefined;
|
||||||
resolve();
|
resolve();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user