Skip to content

Commit

Permalink
Replace leftover m.redraw(true) with m.redraw.sync()
Browse files Browse the repository at this point in the history
  • Loading branch information
askvortsov1 committed Aug 27, 2020
1 parent c579d66 commit a680c51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/src/forum/components/PostStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export default class PostStream extends Component {
return Promise.all([$container.promise(), this.stream.loadPromise]).then(() => {
this.updateScrubber();
const index = $item.data('index');
m.redraw(true);
m.redraw.sync();
const scroll = index == 0 ? 0 : $(`.PostStream-item[data-index=${$item.data('index')}]`).offset().top - this.getMarginTop();
$(window).scrollTop(scroll);
this.calculatePosition();
Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/states/PostStreamState.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class PostStreamState {
this.loadRange(start, end).then(() => {
if (start >= this.visibleStart && end <= this.visibleEnd) {
const anchorIndex = backwards ? this.visibleEnd - 1 : this.visibleStart;
anchorScroll(`.PostStream-item[data-index="${anchorIndex}"]`, () => m.redraw(true));
anchorScroll(`.PostStream-item[data-index="${anchorIndex}"]`, () => m.redraw.sync());
}
this.pagesLoading--;
});
Expand Down

0 comments on commit a680c51

Please sign in to comment.