FIX: Reload messages after a bulk operation (#12569)

It did not show the updated state of the topic until user refreshed the
page.
This commit is contained in:
Bianca Nenciu 2021-03-31 16:08:12 +03:00 committed by GitHub
parent 198c960b52
commit 27b297472a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -253,7 +253,7 @@ export default Controller.extend(ModalFunctionality, {
if (this.isGroup) {
params.group = this.groupFilter;
}
this.forEachPerformed(params, (t) => t.set("archived", true));
this.performAndRefresh(params);
},
moveMessagesToInbox() {
@ -261,7 +261,7 @@ export default Controller.extend(ModalFunctionality, {
if (this.isGroup) {
params.group = this.groupFilter;
}
this.forEachPerformed(params, (t) => t.set("archived", false));
this.performAndRefresh(params);
},
unlistTopics() {

View File

@ -55,6 +55,7 @@ export default Controller.extend({
@action
toggleBulkSelect() {
this.selected.clear();
this.toggleProperty("bulkSelectEnabled");
},
});

View File

@ -29,6 +29,10 @@ export default DiscourseRoute.extend({
},
actions: {
refresh() {
this.refresh();
},
willTransition: function () {
this._super(...arguments);
this.controllerFor("user").set("pmView", null);

View File

@ -60,7 +60,7 @@
{{#unless site.mobileView}}
{{#if showToggleBulkSelect}}
{{d-button icon="list" class="btn-default bulk-select" title="topics.bulk.toggle" action=(action "toggleBulkSelect")}}
{{bulk-select-button selected=selected}}
{{bulk-select-button selected=selected action=(route-action "refresh")}}
{{/if}}
{{/unless}}