1
0
mirror of https://github.com/flarum/core.git synced 2025-08-11 10:55:47 +02:00

update: forum/components/DiscussionList

This commit is contained in:
Alexander Skvortsov
2020-08-08 11:37:56 -04:00
committed by Franz Liedke
parent d71f77d592
commit eb440bb9b6

View File

@@ -12,12 +12,8 @@ import Placeholder from '../../common/components/Placeholder';
* - `state` A DiscussionListState object that represents the discussion lists's state.
*/
export default class DiscussionList extends Component {
init() {
this.state = this.props.state;
}
view() {
const state = this.state;
view(vnode) {
const state = this.attrs.state;
const params = state.getParams();
let loading;
@@ -25,11 +21,13 @@ export default class DiscussionList extends Component {
if (state.isLoading()) {
loading = LoadingIndicator.component();
} else if (state.moreResults) {
loading = Button.component({
children: app.translator.trans('core.forum.discussion_list.load_more_button'),
className: 'Button',
onclick: state.loadMore.bind(state),
});
loading = Button.component(
{
className: 'Button',
onclick: state.loadMore.bind(state),
},
app.translator.trans('core.forum.discussion_list.load_more_button')
);
}
if (state.empty()) {