Fix hidden floating topbar

Fix reaction animation again
Warn: do not reflow bubbles after animation
This commit is contained in:
Eduard Kuzmenko 2022-03-28 19:49:07 +03:00
parent 00f5a634a4
commit 1113ef0642
5 changed files with 21 additions and 9 deletions

View File

@ -4102,9 +4102,9 @@ export default class ChatBubbles {
// ! в хроме, каким-то образом из-за zoom-fade класса начинает прыгать скролл при подгрузке сообщений вверх,
// ! т.е. скролл не ставится, так же, как в сафари при translateZ на блок выше scrollable
if(!IS_SAFARI) {
this.needReflowScroll = true;
}
// if(!IS_SAFARI) {
// this.needReflowScroll = true;
// }
});
}

View File

@ -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;

View File

@ -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);

View File

@ -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 (

View File

@ -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 = '';