Skip to content

Commit 57ada7c

Browse files
committed
Added options for startFeedbackFlow
1 parent 445c3fd commit 57ada7c

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

demo/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ setTimeout(() => {
4242

4343
const ii = () => {
4444
// :)
45+
x();
4546
}
4647

4748
setTimeout(() => {

index.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ export namespace Gleap {
6565
): void;
6666
function open(): void;
6767
function hide(): void;
68-
function startFeedbackFlow(feedbackFlow: string, actionOutboundId?: string, autostartDrawing?: boolean): void;
68+
function startFeedbackFlow(feedbackFlow: string, options?: {
69+
actionOutboundId?: string,
70+
autostartDrawing?: boolean,
71+
showBackButton?: boolean
72+
}): void;
6973
function on(event: string, callback: (data?: any) => void): void;
7074
}
7175
export default Gleap;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "7.0.0",
3+
"version": "7.0.1",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

src/Gleap.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ class Gleap {
431431
/**
432432
* Starts the bug reporting flow.
433433
*/
434-
static startFeedbackFlow(feedbackFlow, actionOutboundId = undefined, autostartDrawing = false) {
434+
static startFeedbackFlow(feedbackFlow, options = {}) {
435+
const { actionOutboundId, autostartDrawing, hideBackButton } = options;
435436
const sessionInstance = GleapSession.getInstance();
436437
if (!sessionInstance.ready) {
437438
return;
@@ -448,6 +449,7 @@ class Gleap {
448449
data: {
449450
flow: feedbackFlow,
450451
actionOutboundId: actionOutboundId,
452+
hideBackButton: hideBackButton,
451453
}
452454
});
453455

@@ -489,7 +491,10 @@ class Gleap {
489491
*/
490492
performAction(action) {
491493
if (action && action.outbound && action.actionType) {
492-
Gleap.startFeedbackFlow(action.actionType, action.outbound);
494+
Gleap.startFeedbackFlow(action.actionType, {
495+
actionOutboundId: action.outbound,
496+
hideBackButton: true
497+
});
493498
}
494499
}
495500

src/GleapConfigManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default class GleapConfigManager {
125125
Gleap.enableShortcuts(flowConfig.enableShortcuts ? true : false);
126126

127127

128-
} catch (e) { }
128+
} catch (e) {}
129129
}
130130

131131
getFeedbackOptions(feedbackFlow) {

src/GleapFrameManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default class GleapFrameManager {
66
injectedFrame = false;
77
widgetOpened = false;
88
listeners = [];
9-
frameURL = "https://frame.gleap.io";
9+
frameURL = "http://localhost:3000"; // "https://frame.gleap.io";
1010
markerManager = undefined;
1111
escListener = undefined;
1212
frameHeight = 0;

src/GleapShortcutListener.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export default class GleapShortcutListener {
3636
e.ctrlKey &&
3737
(char === "i" || char === "I" || char === 73)
3838
) {
39-
Gleap.startFeedbackFlow("bugreporting", undefined, true);
39+
Gleap.startFeedbackFlow("bugreporting", {
40+
autostartDrawing: true
41+
});
4042
}
4143
});
4244
}

0 commit comments

Comments
 (0)