From 1760ad42d819589ae3d058f505f32cf91209cd0e Mon Sep 17 00:00:00 2001 From: morethanwords Date: Sun, 26 Sep 2021 00:04:54 +0400 Subject: [PATCH] Fix opening 'Add Contact' tab --- src/components/chat/topbar.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/chat/topbar.ts b/src/components/chat/topbar.ts index aa023d1a..53869479 100644 --- a/src/components/chat/topbar.ts +++ b/src/components/chat/topbar.ts @@ -278,9 +278,13 @@ export default class ChatTopbar { icon: 'adduser', text: 'AddContact', onClick: () => { - const tab = new AppEditContactTab(this.appSidebarRight); - tab.peerId = this.peerId; - tab.open(); + if(!this.appSidebarRight.isTabExists(AppEditContactTab)) { + const tab = new AppEditContactTab(this.appSidebarRight); + tab.peerId = this.peerId; + tab.open(); + + this.appSidebarRight.toggleSidebar(true); + } }, verify: () => this.peerId > 0 && !this.appUsersManager.isContact(this.peerId) }, {