Skip to content

Commit b3c3e87

Browse files
committed
v6.8.6
1 parent 5e52845 commit b3c3e87

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Gleap = window.Gleap;
22

3-
Gleap.setApiUrl("http://localhost:9000");
3+
// Gleap.setApiUrl("http://localhost:9000");
44
Gleap.initialize("6aDbcY8I6uo5qc0CnJbfAI8mCXInmsvP");
55
Gleap.identify(333, {
66
email: "lukas@gle.aaa",

published/6.8.6/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AutoConfig.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ export default class AutoConfig {
66
static run = () => {
77
const cachedConfig = loadFromGleapCache("config");
88
if (cachedConfig) {
9-
AutoConfig.applyConfig(cachedConfig, false);
10-
AutoConfig.loadConfigFromServer(true);
9+
AutoConfig.applyConfig(cachedConfig);
10+
AutoConfig.loadConfigFromServer(false);
1111
return Promise.resolve();
1212
}
1313

14-
return AutoConfig.loadConfigFromServer();
14+
return AutoConfig.loadConfigFromServer(true);
1515
};
1616

17-
static loadConfigFromServer = (updateCacheOnly = false) => {
17+
static loadConfigFromServer = (updateConfig = false) => {
1818
return new Promise(function (resolve) {
1919
const session = Session.getInstance();
2020
const http = new XMLHttpRequest();
@@ -32,7 +32,12 @@ export default class AutoConfig {
3232
if (http.status === 200 || http.status === 201) {
3333
try {
3434
const config = JSON.parse(http.responseText);
35-
AutoConfig.applyConfig(config, updateCacheOnly);
35+
try {
36+
saveToGleapCache("config", config);
37+
} catch (exp) {}
38+
if (updateConfig) {
39+
AutoConfig.applyConfig(config);
40+
}
3641
} catch (e) {}
3742
}
3843
resolve();
@@ -42,11 +47,7 @@ export default class AutoConfig {
4247
});
4348
};
4449

45-
static applyConfig(config, updateCacheOnly = false) {
46-
try {
47-
saveToGleapCache("config", config);
48-
} catch (exp) {}
49-
50+
static applyConfig(config) {
5051
try {
5152
const flowConfig = config.flowConfig;
5253
const projectActions = config.projectActions;
@@ -72,10 +73,6 @@ export default class AutoConfig {
7273
Gleap.enablePoweredBy();
7374
}
7475

75-
if (updateCacheOnly) {
76-
return;
77-
}
78-
7976
if (flowConfig.networkLogPropsToIgnore) {
8077
Gleap.setNetworkLogFilters(flowConfig.networkLogPropsToIgnore);
8178
}

src/Session.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,16 @@ export default class Session {
130130
}
131131

132132
checkIfSessionNeedsUpdate = (userId, userData) => {
133-
if (!this.session) {
133+
if (!this.session || !this.session.userId || !userId) {
134134
return true;
135135
}
136136

137-
if (this.session.userId.toString() !== userId.toString()) {
138-
return true;
137+
try {
138+
if (this.session.userId.toString() !== userId.toString()) {
139+
return true;
140+
}
141+
} catch (exp) {
142+
console.log("Gleap: warn");
139143
}
140144

141145
if (userData) {

0 commit comments

Comments
 (0)