FIX: Show bookmarks loading spinner correctly (#17726)

There was a minor issue where the bookmark loading
spinner would not show correctly because of how
the route was handling the setting of loading,
this fixes the issue.
This commit is contained in:
Martin Brennan 2022-07-29 12:31:53 +10:00 committed by GitHub
parent 6849775a2d
commit 6bb77d3055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 11 deletions

View File

@ -15,7 +15,7 @@ export default Controller.extend({
application: controller(), application: controller(),
user: controller(), user: controller(),
loading: false, loading: true,
loadingMore: false, loadingMore: false,
permissionDenied: false, permissionDenied: false,
inSearchMode: notEmpty("q"), inSearchMode: notEmpty("q"),

View File

@ -40,7 +40,8 @@ export default DiscourseRoute.extend({
this.session.set("bookmarksModel", model); this.session.set("bookmarksModel", model);
return model; return model;
}) })
.catch(() => controller.set("permissionDenied", true)); .catch(() => controller.set("permissionDenied", true))
.finally(() => controller.set("loading", false));
}, },
renderTemplate() { renderTemplate() {
@ -53,15 +54,6 @@ export default DiscourseRoute.extend({
return true; return true;
}, },
@action
loading(transition) {
let controller = this.controllerFor("user-activity-bookmarks");
controller.set("loading", true);
transition.promise.finally(function () {
controller.set("loading", false);
});
},
@action @action
triggerRefresh() { triggerRefresh() {
this.refresh(); this.refresh();