1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Rename discussion.startPost

This commit is contained in:
Toby Zerner
2018-08-24 20:42:07 +09:30
parent cbd0643540
commit e241518506
9 changed files with 16 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ Object.assign(Discussion.prototype, {
startTime: Model.attribute('startTime', Model.transformDate),
startUser: Model.hasOne('startUser'),
startPost: Model.hasOne('startPost'),
firstPost: Model.hasOne('firstPost'),
lastTime: Model.attribute('lastTime', Model.transformDate),
lastUser: Model.hasOne('lastUser'),

View File

@@ -156,7 +156,7 @@ export default class DiscussionListItem extends Component {
*
* @return {Boolean}
*/
showStartPost() {
showFirstPost() {
return ['newest', 'oldest'].indexOf(this.props.params.sort) !== -1;
}
@@ -192,7 +192,7 @@ export default class DiscussionListItem extends Component {
const items = new ItemList();
if (this.props.params.q) {
const post = this.props.discussion.mostRelevantPost() || this.props.discussion.startPost();
const post = this.props.discussion.mostRelevantPost() || this.props.discussion.firstPost();
if (post && post.contentType() === 'comment') {
const excerpt = highlight(post.contentPlain(), this.highlightRegExp, 175);
@@ -202,7 +202,7 @@ export default class DiscussionListItem extends Component {
items.add('terminalPost',
TerminalPost.component({
discussion: this.props.discussion,
lastPost: !this.showStartPost()
lastPost: !this.showFirstPost()
})
);
}