diff --git a/src/components/sidebarLeft/index.ts b/src/components/sidebarLeft/index.ts index f787bdffb..402d83b45 100644 --- a/src/components/sidebarLeft/index.ts +++ b/src/components/sidebarLeft/index.ts @@ -503,6 +503,8 @@ export class AppSidebarLeft extends SidebarSlider { const isCollapsed = !this.hasTabsInNavigation() && !this.isSearchActive && width < MIN_SIDEBAR_WIDTH * 0.65; this.sidebarEl.classList.toggle('is-collapsed', isCollapsed); + appImManager.adjustChatPatternBackground(); + throttledSetToStorage(isCollapsed ? 0 : clampedWidth); }, onReset: () => { diff --git a/src/lib/appManagers/appImManager.ts b/src/lib/appManagers/appImManager.ts index d0879f87d..0256cc969 100644 --- a/src/lib/appManagers/appImManager.ts +++ b/src/lib/appManagers/appImManager.ts @@ -312,15 +312,13 @@ export class AppImManager extends EventListenerBase<{ mediaSizes.addEventListener('resize', () => { // const perf = performance.now(); - const rect = this.chatsContainer.getBoundingClientRect(); - ChatBackgroundPatternRenderer.resizeInstances(rect.width, rect.height).then(() => { - // this.log.warn('resize bg time:', performance.now() - perf); - // for(const chat of this.chats) { - // if(chat.renderDarkPattern) { - // chat.renderDarkPattern(); - // } - // } - }); + this.adjustChatPatternBackground(); + // this.log.warn('resize bg time:', performance.now() - perf); + // for(const chat of this.chats) { + // if(chat.renderDarkPattern) { + // chat.renderDarkPattern(); + // } + // } }); const onPeerChanging = (chat: Chat) => { @@ -691,6 +689,11 @@ export class AppImManager extends EventListenerBase<{ // PopupElement.createPopup(PopupBoostsViaGifts, -5000866300); } + public adjustChatPatternBackground() { + const rect = this.chatsContainer.getBoundingClientRect(); + ChatBackgroundPatternRenderer.resizeInstances(rect.width, rect.height); + } + private checkForShare() { const share = apiManagerProxy.share; if(share) {