Browse Source

Fix glitch on first forwarding in inner chat

master
Eduard Kuzmenko 3 years ago
parent
commit
d31a819d7d
  1. 7
      src/components/chat/bubbles.ts

7
src/components/chat/bubbles.ts

@ -883,7 +883,7 @@ export default class ChatBubbles {
} }
const container = this.scrollable.container; const container = this.scrollable.container;
let wasHeight = container.offsetHeight; let wasHeight = 0/* container.offsetHeight */;
let resizing = false; let resizing = false;
let skip = false; let skip = false;
let scrolled = 0; let scrolled = 0;
@ -4052,9 +4052,10 @@ export default class ChatBubbles {
if(scrollSaver) { if(scrollSaver) {
scrollSaver.restore(history.length === 1 && !reverse ? false : true); scrollSaver.restore(history.length === 1 && !reverse ? false : true);
const className = 'has-sticky-dates';
const state = scrollSaver.getSaved(); const state = scrollSaver.getSaved();
const isLoading = !this.preloader.detached; const isLoading = !this.preloader.detached;
if(state.scrollHeight !== state.clientHeight || isLoading) { if((state.scrollHeight !== state.clientHeight || isLoading) && !this.bubblesContainer.classList.contains(className)) {
/* for(const timestamp in this.dateMessages) { /* for(const timestamp in this.dateMessages) {
const dateMessage = this.dateMessages[timestamp]; const dateMessage = this.dateMessages[timestamp];
dateMessage.div.classList.add('is-sticky'); dateMessage.div.classList.add('is-sticky');
@ -4063,7 +4064,7 @@ export default class ChatBubbles {
const middleware = this.getMiddleware(); const middleware = this.getMiddleware();
const callback = () => { const callback = () => {
if(!middleware()) return; if(!middleware()) return;
this.bubblesContainer.classList.add('has-sticky-dates'); this.bubblesContainer.classList.add(className);
}; };
if(this.willScrollOnLoad) { if(this.willScrollOnLoad) {

Loading…
Cancel
Save