Skip to content

Commit

Permalink
Ensure that the store only checks if the map context is available. In…
Browse files Browse the repository at this point in the history
…cluded comments.
  • Loading branch information
alexgleith committed Nov 14, 2017
1 parent 84b0e29 commit 816aef3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ function refreshSelectedCoordinates(options) {
/**
* Stores the initial config for a map, so that we can set it again after we're done.
*/
Store.prototype.storeMapconfig = function(constants) {
Store.prototype.storeMapConfig = function(constants) {
constants.interactions.forEach((interaction) => {
const interactionSet = this.ctx.map[interaction];
if (interactionSet) {
Expand All @@ -324,13 +324,14 @@ Store.prototype.restoreMapConfig = function() {
* Returns the initial state of an interaction setting.
* @param {string} interaction
* @return {boolean} `true` if the interaction is enabled, `false` if not.
* Defaults to `true`. (Todo: include defaults.)
* Defaults to `true`. (Todo: include dynamic defaults.)
*/
Store.prototype.getInitialConfigValue = function(interaction) {
if (this._mapInitialConfig[interaction]) {
if (this._mapInitialConfig[interaction] !== undefined) {
return this._mapInitialConfig[interaction];
} else {
// This needs to be set to whatever the default is for that interaction
return false;
// This probably should be set to whatever the default is for that interaction
// Currently, all appear to be true, so default to true
return true;
}
};

0 comments on commit 816aef3

Please sign in to comment.