Skip to content
Snippets Groups Projects
Commit f7eb8d44 authored by Ramon Souza's avatar Ramon Souza
Browse files

recompute heights multiple times when switching between public and private chats

parent db769d08
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,7 @@ class TimeWindowList extends PureComponent {
) {
if (chatId !== prevChatId){
this.systemMessageIndexes.forEach(index => {
this.listRef.recomputeRowHeights(index);
this.clearAndRecompute(index);
});
}
this.listRef.forceUpdateGrid();
......@@ -160,6 +160,17 @@ class TimeWindowList extends PureComponent {
handleScrollUpdate(position || 1);
}
clearAndRecompute(index) {
[500, 1000, 2000, 3000, 4000, 5000].forEach((i)=>{
setTimeout(() => {
if (this.listRef) {
this.cache.clear(index);
this.listRef.recomputeRowHeights(index);
}
}, i);
})
}
scrollTo(position = null) {
if (position) {
setTimeout(() => this.setState({
......@@ -193,14 +204,7 @@ class TimeWindowList extends PureComponent {
if (needResizeMessages.includes(message.key)) {
if (!this.systemMessageIndexes.includes(index)) {
this.systemMessageIndexes.push(index);
[500, 1000, 2000, 3000, 4000, 5000].forEach((i)=>{
setTimeout(() => {
if (this.listRef) {
this.cache.clear(index);
this.listRef.recomputeRowHeights(index);
}
}, i);
})
this.clearAndRecompute(index);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment