FIX: Clciking the home logo wasn't refreshing categories views

This commit is contained in:
Robin Ward 2017-03-24 16:30:00 -04:00
parent 276d139624
commit 80edb4cebc

View File

@ -92,14 +92,15 @@ const DiscoveryCategoriesRoute = Discourse.Route.extend(OpenComposer, {
refresh() {
const controller = this.controllerFor("discovery/categories");
const discController = this.controllerFor("discovery");
// Don't refresh if we're still loading
if (!controller || controller.get("loading")) { return; }
if (!discController || discController.get("loading")) { return; }
// If we `send('loading')` here, due to returning true it bubbles up to the
// router and ember throws an error due to missing `handlerInfos`.
// Lesson learned: Don't call `loading` yourself.
controller.set("loading", true);
discController.set("loading", true);
this.model().then(model => {
this.setupController(controller, model);