From 61a06abd59c4e58ef18ce506ba11dc71a2b9655c Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 4 Aug 2015 19:13:42 +0930 Subject: [PATCH] Allow discussion list to be refreshed without clearing it --- js/forum/src/components/DiscussionList.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/forum/src/components/DiscussionList.js b/js/forum/src/components/DiscussionList.js index 24ef71adb..c38001580 100644 --- a/js/forum/src/components/DiscussionList.js +++ b/js/forum/src/components/DiscussionList.js @@ -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();