Browse Source

Fix hidden floating topbar

Fix reaction animation again
Warn: do not reflow bubbles after animation
master
Eduard Kuzmenko 3 years ago
parent
commit
1113ef0642
  1. 6
      src/components/chat/bubbles.ts
  2. 8
      src/components/chat/pinnedContainer.ts
  3. 6
      src/components/chat/topbar.ts
  4. 6
      src/lib/appManagers/appMessagesManager.ts
  5. 2
      webpack.common.js

6
src/components/chat/bubbles.ts

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

8
src/components/chat/pinnedContainer.ts

@ -112,6 +112,14 @@ export default class PinnedContainer { @@ -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;

6
src/components/chat/topbar.ts

@ -868,7 +868,11 @@ export default class ChatTopbar { @@ -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);

6
src/lib/appManagers/appMessagesManager.ts

@ -6354,9 +6354,9 @@ export class AppMessagesManager { @@ -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 (

2
webpack.common.js

@ -37,7 +37,7 @@ const opts = { @@ -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 = '';

Loading…
Cancel
Save