Skip to content

Commit d9484e8

Browse files
committed
v8.3.7
1 parent 8c658d0 commit d9484e8

File tree

8 files changed

+44
-16
lines changed

8 files changed

+44
-16
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const Gleap = window.Gleap;
22

3-
//Gleap.setFrameUrl("http://0.0.0.0:3001");
4-
//Gleap.setApiUrl("http://0.0.0.0:9000");
3+
Gleap.setFrameUrl("http://0.0.0.0:3001");
4+
Gleap.setApiUrl("http://0.0.0.0:9000");
55
Gleap.initialize("ek98ANmHary9PQNG5EIl6TQd3SzqstZA");
66
//Gleap.setEnvironment("dev");
77

index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ export namespace Gleap {
7474
function open(): void;
7575
function openNews(showBackButton?: boolean): void;
7676
function openNewsArticle(
77-
collectionId: string,
78-
articleId?: string,
77+
id: string,
7978
showBackButton?: boolean
8079
): void;
8180
function openConversations(showBackButton?: boolean): void;
@@ -84,7 +83,8 @@ export namespace Gleap {
8483
showBackButton?: boolean
8584
): void;
8685
function openHelpCenter(showBackButton?: boolean): void;
87-
function openHelpArticle(id: string, showBackButton?: boolean): void;
86+
function openHelpCollection(collectionId: string, showBackButton?: boolean): void;
87+
function openHelpArticle(articleId: string, showBackButton?: boolean): void;
8888
function searchHelpCenter(term: string, showBackButton?: boolean): void;
8989
function openFeatureRequests(showBackButton?: boolean): void;
9090
function close(): void;

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": "8.3.6",
3+
"version": "8.3.7",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/8.3.7/index.js

Lines changed: 1 addition & 0 deletions
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/Gleap.js

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ class Gleap {
497497
);
498498
feedback
499499
.sendFeedback()
500-
.then(() => {})
501-
.catch((error) => {});
500+
.then(() => { })
501+
.catch((error) => { });
502502
}
503503

504504
/**
@@ -620,9 +620,9 @@ class Gleap {
620620
}
621621

622622
/**
623-
* Opens a help article
623+
* Opens a help center collection
624624
*/
625-
static openHelpArticle(collectionId, articleId, showBackButton = true) {
625+
static openHelpCollection(collectionId, showBackButton = true) {
626626
if (!collectionId) {
627627
return;
628628
}
@@ -631,9 +631,32 @@ class Gleap {
631631

632632
GleapFrameManager.getInstance().sendMessage(
633633
{
634-
name: "open-help-article",
634+
name: "open-help-collection",
635635
data: {
636636
collectionId,
637+
hideBackButton: !showBackButton,
638+
},
639+
},
640+
true
641+
);
642+
643+
GleapFrameManager.getInstance().showWidget();
644+
}
645+
646+
/**
647+
* Opens a help article
648+
*/
649+
static openHelpArticle(articleId, showBackButton = true) {
650+
if (!articleId) {
651+
return;
652+
}
653+
654+
GleapFrameManager.getInstance().setAppMode("widget");
655+
656+
GleapFrameManager.getInstance().sendMessage(
657+
{
658+
name: "open-help-article",
659+
data: {
637660
articleId,
638661
hideBackButton: !showBackButton,
639662
},
@@ -836,7 +859,7 @@ class Gleap {
836859
this.setGlobalDataItem("webReplay", replayData);
837860
}
838861
})
839-
.catch((exp) => {});
862+
.catch((exp) => { });
840863
}
841864
}
842865

src/GleapAudioManager.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ export default class GleapAudioManager {
66
if (!this.audio) {
77
this.audio = new Audio('https://js.gleap.io/res/ping.mp3');
88
}
9-
10-
this.audio.play();
9+
10+
const playPromise = this.audio.play();
11+
if (playPromise !== undefined) {
12+
playPromise.then(_ => { })
13+
.catch(error => { });
14+
}
1115
} catch (exp) { }
1216
}
1317
}

0 commit comments

Comments
 (0)