mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 23:29:57 +08:00
Allow discussion list to be refreshed without clearing it
This commit is contained in:
@ -123,12 +123,17 @@ export default class DiscussionList extends Component {
|
|||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
refresh() {
|
refresh(clear = true) {
|
||||||
|
if (clear) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.discussions = [];
|
this.discussions = [];
|
||||||
|
}
|
||||||
|
|
||||||
this.loadResults().then(
|
return this.loadResults().then(
|
||||||
this.parseResults.bind(this),
|
results => {
|
||||||
|
this.discussions = [];
|
||||||
|
this.parseResults(results);
|
||||||
|
},
|
||||||
() => {
|
() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
m.redraw();
|
m.redraw();
|
||||||
|
Reference in New Issue
Block a user