Don't save index twice in post stream post-load

This commit is contained in:
Alexander Skvortsov 2020-07-10 13:01:57 -04:00 committed by Franz Liedke
parent f99f79e3c0
commit 8c362bf7c7
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -327,9 +327,9 @@ export default class PostStream extends Component {
return Promise.all([$container.promise(), this.state.loadPromise]).then(() => {
this.updateScrubber();
this.state.index = $item.data('index');
const index = $item.data('index');
m.redraw(true);
const scroll = this.state.index == 0 ? 0 : $(`.PostStream-item[data-index=${$item.data('index')}]`).offset().top - this.getMarginTop();
const scroll = index == 0 ? 0 : $(`.PostStream-item[data-index=${$item.data('index')}]`).offset().top - this.getMarginTop();
$(window).scrollTop(scroll);
this.calculatePosition();
this.state.paused = false;