1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 09:26:34 +02:00

Fix date not showing up properly

This commit is contained in:
Alexander Skvortsov
2020-07-07 21:54:46 -04:00
committed by Franz Liedke
parent 88e6be9d0e
commit 5ef4de75d1
2 changed files with 3 additions and 3 deletions

View File

@@ -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();
});
}

View File

@@ -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') : '';
}
/**