diff --git a/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 b/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 index 9f4c76ee7d..d254e0e6a2 100644 --- a/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 +++ b/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 @@ -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);