From 1113ef0642c7c894e65a39923af229da5ab2d027 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Mon, 28 Mar 2022 19:49:07 +0300 Subject: [PATCH] Fix hidden floating topbar Fix reaction animation again Warn: do not reflow bubbles after animation --- src/components/chat/bubbles.ts | 6 +++--- src/components/chat/pinnedContainer.ts | 8 ++++++++ src/components/chat/topbar.ts | 6 +++++- src/lib/appManagers/appMessagesManager.ts | 8 ++++---- webpack.common.js | 2 +- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index 580d0870..9ba3462d 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -4102,9 +4102,9 @@ export default class ChatBubbles { // ! в хроме, каким-то образом из-за zoom-fade класса начинает прыгать скролл при подгрузке сообщений вверх, // ! т.е. скролл не ставится, так же, как в сафари при translateZ на блок выше scrollable - if(!IS_SAFARI) { - this.needReflowScroll = true; - } + // if(!IS_SAFARI) { + // this.needReflowScroll = true; + // } }); } diff --git a/src/components/chat/pinnedContainer.ts b/src/components/chat/pinnedContainer.ts index 63a50ac6..3ec5b2f7 100644 --- a/src/components/chat/pinnedContainer.ts +++ b/src/components/chat/pinnedContainer.ts @@ -112,6 +112,14 @@ export default class PinnedContainer { this.topbar.setUtilsWidth(); } + public isVisible() { + return !this.divAndCaption.container.classList.contains('hide'); + } + + public isFloating() { + return this.divAndCaption.container.classList.contains('is-floating'); + } + public fill(title: string | HTMLElement | DocumentFragment, subtitle: string | HTMLElement | DocumentFragment, message: Message.message) { this.divAndCaption.container.dataset.peerId = '' + message.peerId; this.divAndCaption.container.dataset.mid = '' + message.mid; diff --git a/src/components/chat/topbar.ts b/src/components/chat/topbar.ts index 593458c1..a357f3e3 100644 --- a/src/components/chat/topbar.ts +++ b/src/components/chat/topbar.ts @@ -868,7 +868,11 @@ export default class ChatTopbar { public setFloating = () => { const containers = [this.chatAudio, this.pinnedMessage && this.pinnedMessage.pinnedMessageContainer].filter(Boolean); const count = containers.reduce((acc, container) => { - const isFloating = container.divAndCaption.container.classList.contains('is-floating'); + if(!container.isVisible()) { + return acc; + } + + const isFloating = container.isFloating(); this.container.classList.toggle(`is-pinned-${container.className}-floating`, isFloating); return acc + +isFloating; }, 0); diff --git a/src/lib/appManagers/appMessagesManager.ts b/src/lib/appManagers/appMessagesManager.ts index ac81e4c3..fb3ecf30 100644 --- a/src/lib/appManagers/appMessagesManager.ts +++ b/src/lib/appManagers/appMessagesManager.ts @@ -4732,7 +4732,7 @@ export class AppMessagesManager { const key = message.peerId + '_' + message.mid; this.pushBatchUpdate('messages_reactions', this.batchUpdateReactions, key, () => copy(message.reactions)); - + message.reactions = reactions; if(!update.local) { @@ -6354,9 +6354,9 @@ export class AppMessagesManager { const toDispatch: {message: Message.message, changedResults: ReactionCount.reactionCount[]}[] = []; const map = this.getMessagesFromMap(batch); - for(const [message, reactions] of map) { - const results = reactions?.results ?? []; - const previousResults = message.reactions?.results ?? []; + for(const [message, previousReactions] of map) { + const results = message.reactions?.results ?? []; + const previousResults = previousReactions?.results ?? []; const changedResults = results.filter(reactionCount => { const previousReactionCount = previousResults.find(_reactionCount => _reactionCount.reaction === reactionCount.reaction); return ( diff --git a/webpack.common.js b/webpack.common.js index 9c23846b..79ad9325 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -37,7 +37,7 @@ const opts = { }; const domain = 'yourdomain.com'; -const localIp = '10.17.0.210'; +const localIp = '192.168.100.51'; const middleware = (req, res, next) => { let IP = '';