1
0
mirror of https://github.com/flarum/core.git synced 2025-02-24 19:23:01 +01:00

Allow discussion list to be refreshed without clearing it

This commit is contained in:
Toby Zerner 2015-08-04 19:13:42 +09:30
parent 26c87de317
commit 61a06abd59

View File

@ -123,12 +123,17 @@ export default class DiscussionList extends Component {
*
* @public
*/
refresh() {
this.loading = true;
this.discussions = [];
refresh(clear = true) {
if (clear) {
this.loading = true;
this.discussions = [];
}
this.loadResults().then(
this.parseResults.bind(this),
return this.loadResults().then(
results => {
this.discussions = [];
this.parseResults(results);
},
() => {
this.loading = false;
m.redraw();