From f0cdecc5b8153289fd1759cd4a96d63bfa57162d Mon Sep 17 00:00:00 2001 From: morethanwords Date: Tue, 1 Sep 2020 16:12:52 +0300 Subject: [PATCH] Fix empty notification --- src/components/horizontalMenu.ts | 2 +- src/lib/appManagers/appSidebarRight.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/horizontalMenu.ts b/src/components/horizontalMenu.ts index 6cb97dd5..d0c72578 100644 --- a/src/components/horizontalMenu.ts +++ b/src/components/horizontalMenu.ts @@ -146,7 +146,7 @@ export function horizontalMenu(tabs: HTMLElement, content: HTMLElement, onClick? const scaleFactor = currentIndicator.clientWidth / indicator.clientWidth; indicator.style.transform = `translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`; - console.log(`translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`); + //console.log(`translate3d(${shiftLeft}px, 0, 0) scale3d(${scaleFactor}, 1, 1)`); requestAnimationFrame(() => { // Now we remove the transform to let it animate to its own position and size. diff --git a/src/lib/appManagers/appSidebarRight.ts b/src/lib/appManagers/appSidebarRight.ts index cdfbb79b..fd67f82d 100644 --- a/src/lib/appManagers/appSidebarRight.ts +++ b/src/lib/appManagers/appSidebarRight.ts @@ -619,16 +619,16 @@ export class AppSidebarRight extends SidebarSlider { if(this.loadMutex) { promises.push(this.loadMutex); } + + if(promises.length) { + await Promise.all(promises); + if(this.peerID != peerID) { + this.log.warn('peer changed'); + return; + } + } if(elemsToAppend.length) { - if(promises.length) { - await Promise.all(promises); - if(this.peerID != peerID) { - this.log.warn('peer changed'); - return; - } - } - sharedMediaDiv.append(...elemsToAppend); }