From 07f092d7c30a8881926bbc84144cc99fc6b5f3a3 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Fri, 29 Jan 2021 14:18:03 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fixes=20issue=20where=20s?= =?UTF-8?q?cope=20nav=20is=20empty=20after=20login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/routes/scopes/scope.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/admin/app/routes/scopes/scope.js b/ui/admin/app/routes/scopes/scope.js index 705c8d168..32c7945c0 100644 --- a/ui/admin/app/routes/scopes/scope.js +++ b/ui/admin/app/routes/scopes/scope.js @@ -67,16 +67,27 @@ export default class ScopesScopeRoute extends Route { this.scope.org = selectedOrg; this.scope.project = selectedProject; this.scopes = { orgs, projects, selectedOrg, selectedProject }; + // Update the controller (if exists), since setupController is only + // called once the first time the route is activated. It is not called + // again on route refreshes. + if (this.controller) this.setControllerProperties(this.scopes); } /** * Adds the scopes hash to the controller context (see `afterModel`). * @param {Controller} controller */ - setupController(controller) { + setupController(/* controller */) { super.setupController(...arguments); - const scopes = this.scopes; - controller.setProperties({ scopes }); + this.setControllerProperties(this.scopes); + } + + /** + * Updates the controller's `scopes`. + * @param {array} scopes + */ + setControllerProperties(scopes) { + this.controller.setProperties({ scopes }); } /**