Skip to content

Commit

Permalink
v8.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Sep 13, 2022
1 parent 0b4184e commit 5068734
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

19 changes: 4 additions & 15 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ Gleap.preFillForm({
"userId": "1233"
});

//Gleap.setFrameUrl("http://0.0.0.0:3001");
//Gleap.setApiUrl("http://0.0.0.0:9000");
Gleap.setFrameUrl("http://0.0.0.0:3001");
Gleap.setApiUrl("http://0.0.0.0:9000");
// Gleap.setLanguage("en");
Gleap.initialize("KProDXhMS0V3UUku2iNnrZ4XsBnAYzxt");
//Gleap.setEnvironment("dev");

Gleap.identify("user_19283", {
name: "[email protected]",
Expand Down Expand Up @@ -56,17 +57,5 @@ setTimeout(() => {


setTimeout(() => {
fetch('https://jsonplaceholder.typicode.com/todos/1', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
})
.then((response) => response.json())
.then((data) => {
console.log('Success:', data);
})
.catch((error) => {
console.error('Error:', error);
});
x();
}, 3000);
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export namespace Gleap {
function open(): void;
function close(): void;
function hide(): void;
function setEnvironment(environment: "dev" | "staging" | "prod"): void;
function showFeedbackButton(show: boolean): void;
function startFeedbackFlow(feedbackFlow: string, showBackButton?: boolean): void;
function on(event: string, callback: (data?: any) => void): void;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "8.0.8",
"version": "8.0.9",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
1 change: 1 addition & 0 deletions published/8.0.9/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/Gleap.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Gleap {
static silentCrashReportSent = false;
initialized = false;
offlineMode = false;

// Global data
globalData = {
screenRecordingData: null,
Expand Down Expand Up @@ -74,6 +74,14 @@ class Gleap {
}
}

/**
* Sets the development environment
* @param {*} environment
*/
static setEnvironment(environment) {
GleapMetaDataManager.getInstance().environment = environment;
}

/**
* Active the Gleap offline mode.
* @param {*} offlineMode
Expand Down
4 changes: 2 additions & 2 deletions src/GleapCrashDetector.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Gleap, { GleapConfigManager, GleapConsoleLogManager } from "./Gleap";
import Gleap, { GleapConfigManager, GleapConsoleLogManager, GleapMetaDataManager } from "./Gleap";

export default class GleapCrashDetector {
// GleapCrashDetector singleton
Expand Down Expand Up @@ -28,7 +28,7 @@ export default class GleapCrashDetector {
GleapConsoleLogManager.getInstance().addLogWithArgs(messageObject, "ERROR");

const flowConfig = GleapConfigManager.getInstance().getFlowConfig();
if (flowConfig && typeof flowConfig.enableCrashDetector !== "undefined" && flowConfig.enableCrashDetector) {
if (flowConfig && typeof flowConfig.enableCrashDetector !== "undefined" && flowConfig.enableCrashDetector && GleapMetaDataManager.getInstance().environment !== "dev") {
if (flowConfig.crashDetectorIsSilent) {
Gleap.sendSilentCrashReportWithFormData(
{
Expand Down
2 changes: 2 additions & 0 deletions src/GleapMetaDataManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default class GleapMetaDataManager {
sessionStart = new Date();
appBuildNumber = "";
appVersionCode = "";
environment = "prod";

// GleapMetaDataManager singleton
static instance;
Expand Down Expand Up @@ -121,6 +122,7 @@ export default class GleapMetaDataManager {
mobile: isMobile(),
sdkVersion: SDK_VERSION,
sdkType: "javascript",
environment: this.environment,
};
}
}
4 changes: 2 additions & 2 deletions src/GleapRageClickDetector.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Gleap, { GleapConfigManager } from "./Gleap";
import Gleap, { GleapConfigManager, GleapMetaDataManager } from "./Gleap";
import { getDOMElementDescription } from "./GleapHelper";

const detectRageClicks = function (subscribe, options) {
Expand Down Expand Up @@ -50,7 +50,7 @@ export default class GleapRageClickDetector {
startRageClickDetector(function (target) {
const elementDescription = getDOMElementDescription(target, false);
const flowConfig = GleapConfigManager.getInstance().getFlowConfig();
if (flowConfig && typeof flowConfig.enableRageClickDetector !== "undefined" && flowConfig.enableRageClickDetector) {
if (flowConfig && typeof flowConfig.enableRageClickDetector !== "undefined" && flowConfig.enableRageClickDetector && GleapMetaDataManager.getInstance().environment !== "dev") {
if (flowConfig.rageClickDetectorIsSilent) {
Gleap.sendSilentCrashReportWithFormData(
{
Expand Down

0 comments on commit 5068734

Please sign in to comment.