Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes unneeded already loaded layer #4905

Merged
merged 1 commit into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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