From 5ef4de75d11111508eddb73586fdbfc9106a9b20 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Tue, 7 Jul 2020 21:54:46 -0400 Subject: [PATCH] Fix date not showing up properly --- js/src/forum/components/PostStream.js | 5 +++-- js/src/forum/states/PostStreamState.js | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/forum/components/PostStream.js b/js/src/forum/components/PostStream.js index baf2dcea6..7a90dfc68 100644 --- a/js/src/forum/components/PostStream.js +++ b/js/src/forum/components/PostStream.js @@ -220,7 +220,7 @@ export default class PostStream extends Component { this.state.index = index; this.state.visible(visible); - this.state.description = period ? dayjs(period).format('MMMM YYYY') : ''; + if (period) this.state.description = dayjs(period).format('MMMM YYYY'); } /** @@ -344,12 +344,13 @@ export default class PostStream extends Component { return Promise.all([$container.promise(), this.state.loadPromise]).then(() => { const index = $item.data('index'); - this.updateScrubber(); m.redraw(true); const scroll = index == 0 ? 0 : $(`.PostStream-item[data-index=${$item.data('index')}]`).offset().top - this.getMarginTop(); $(window).scrollTop(scroll); this.calculatePosition(); + this.updateScrubber(); this.state.unpause(); + m.redraw(); }); } diff --git a/js/src/forum/states/PostStreamState.js b/js/src/forum/states/PostStreamState.js index 8fb4e396d..c7f47b321 100644 --- a/js/src/forum/states/PostStreamState.js +++ b/js/src/forum/states/PostStreamState.js @@ -125,7 +125,6 @@ class PostStreamState { show(posts) { this.visibleStart = posts.length ? this.discussion.postIds().indexOf(posts[0].id()) : 0; this.visibleEnd = this.sanitizeIndex(this.visibleStart + posts.length); - this.description = posts.length ? dayjs(posts[Math.floor(posts.length / 2)].createdAt()).format('MMMM YYYY') : ''; } /**