Skip to content

Commit

Permalink
Adding reload script for config #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Waschnick committed Nov 9, 2017
1 parent cc37d2c commit 49c309c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
7 changes: 0 additions & 7 deletions src/oil.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
* Config Object
* We store and cache our config in this object, later on...
*/
let config = null;

function attachUtilityFunctionsToWindowObject() {
window.oilPreviewModeOn = () => {
Expand All @@ -47,7 +46,6 @@ function attachUtilityFunctionsToWindowObject() {
return 'verbose mode off';
};
window.oilReload = () => {
config = null;
resetConfiguration();
initOilLayer();
return 'OIL reloaded';
Expand All @@ -67,11 +65,6 @@ export function initOilLayer() {

attachUtilityFunctionsToWindowObject();

// Fill config object with configuration data once and for all
if (config === null) {
config = getConfiguration();
}

if (isPreviewMode() && !isPreviewCookieSet()) {
logPreviewInfo('Preview mode not correctly set, please see the documentation on how to set the cookie.');
}
Expand Down
8 changes: 1 addition & 7 deletions src/scripts/poi.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ export function activatePowerOptInWithIFrame(payload) {
});
}

// reset config
config = null;
// init iFrame first
return new Promise((resolve) => init().then(() => {
// then activate
Expand All @@ -196,8 +194,6 @@ export function deActivatePowerOptIn() {
});
}

// reset config
config = null;
// init iFrame first
return new Promise((resolve) => init().then(() => {
// then deactivate
Expand All @@ -221,9 +217,7 @@ export function activatePowerOptInWithRedirect(payload) {
return;
}

if (!config) {
config = getConfiguration();
}
let config = getConfiguration();

if (config) {
let payloadString = JSON.stringify(payload),
Expand Down

0 comments on commit 49c309c

Please sign in to comment.