From 530e5778def92d5aba357cd6adbaa557b2e257f0 Mon Sep 17 00:00:00 2001 From: Michael Kuenzli Date: Thu, 28 Feb 2019 15:57:39 +0100 Subject: [PATCH] [2.2] Update current theme after loadThemes call is done (#4685) Fix order: Load themes before updating them. This allows non-public themes to be available as default themes. --- contribs/gmf/src/controllers/abstract.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contribs/gmf/src/controllers/abstract.js b/contribs/gmf/src/controllers/abstract.js index 528d635f76ce..5f67b014852d 100644 --- a/contribs/gmf/src/controllers/abstract.js +++ b/contribs/gmf/src/controllers/abstract.js @@ -147,11 +147,13 @@ gmf.AbstractController = function(config, $scope, $injector) { // Reload theme when login status changes. const previousThemeName = this.gmfThemeManager.getThemeName(); this.gmfThemeManager.setThemeName('', true); + + // Reload themes and background layer when login status changes. + this.gmfThemes_.loadThemes(roleId); + if (evt.type !== gmf.AuthenticationEventType.READY) { this.updateCurrentTheme_(previousThemeName); } - // Reload themes and background layer when login status changes. - this.gmfThemes_.loadThemes(roleId); this.setDefaultBackground_(null); this.updateHasEditableLayers_(); };