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