Skip to content

Commit

Permalink
Merge pull request #4905 from camptocamp/GSGMF-962
Browse files Browse the repository at this point in the history
Removes unneeded already loaded layer
  • Loading branch information
sbrunner authored May 22, 2019
2 parents 86fefb0 + 0136a7b commit 8647445
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion contribs/gmf/src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const exports = function(config, $scope, $injector) {

if (evt.type !== 'ready') {
const themeName = this.permalink_.defaultThemeNameFromFunctionalities();
this.gmfThemeManager.updateCurrentTheme(themeName, previousThemeName);
this.gmfThemeManager.updateCurrentTheme(themeName, previousThemeName, true);
}
this.setDefaultBackground_(null);
this.updateHasEditableLayers_();
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/layertree/TreeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ exports.prototype.setFirstLevelGroups = function(firstLevelGroups) {
* group.
* @param {boolean=} opt_add if true, force to use the 'add' mode this time.
* @param {boolean=} opt_silent if true notifyCantAddGroups_ is not called.
* @return{boolean} True if the group has been added. False otherwise.
* @return {boolean} True if the group has been added. False otherwise.
* @export
*/
exports.prototype.addFirstLevelGroups = function(firstLevelGroups,
Expand Down
5 changes: 3 additions & 2 deletions contribs/gmf/src/theme/Manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,16 @@ exports.prototype.isLoading = function() {
/**
* @param {string} themeName wanted theme name.
* @param {string} fallbackThemeName fallback theme name.
* @param {boolean=} opt_silent if true notifyCantAddGroups_ is not called.
* @export
*/
exports.prototype.updateCurrentTheme = function(themeName, fallbackThemeName) {
exports.prototype.updateCurrentTheme = function(themeName, fallbackThemeName, opt_silent) {
this.gmfThemes_.getThemesObject().then((themes) => {
if (!themeName && this.modeFlush) {
// In flush mode load current theme private groups
const fallbackTheme = gmfThemeThemes.findThemeByName(themes, /** @type {string} */ (fallbackThemeName));
if (fallbackTheme) {
this.gmfTreeManager_.addFirstLevelGroups(fallbackTheme.children, false, false);
this.gmfTreeManager_.addFirstLevelGroups(fallbackTheme.children, false, opt_silent);
}
}
if (themeName) {
Expand Down
6 changes: 1 addition & 5 deletions src/statemanager/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@ exports.prototype.getInitialValue = function(key) {
* @return {string|undefined} State value.
*/
exports.prototype.getInitialStringValue = function(key) {
const value = this.initialState[key];
if (value === undefined) {
return undefined;
}
return value;
return this.initialState[key];
};


Expand Down

0 comments on commit 8647445

Please sign in to comment.