Skip to content

Commit

Permalink
v12.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Oct 19, 2023
1 parent 977a8b1 commit 446c47e
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions demo/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const Gleap = window.Gleap;

/*Gleap.setFrameUrl("http://0.0.0.0:3001");
Gleap.setFrameUrl("http://0.0.0.0:3001");
Gleap.setApiUrl("http://0.0.0.0:9000");
Gleap.setWSApiUrl("ws://0.0.0.0:8080");*/
Gleap.setWSApiUrl("ws://0.0.0.0:8080");

// Gleap.setLanguage("en");

Expand All @@ -11,3 +11,7 @@ Gleap.initialize("X5C0grjFCjUMbZKi131MjZLaGRwg2iKH");
/*Gleap.setUrlHandler((url, newTab) => {
alert("URL: " + url + " newTab: " + newTab);
});*/

Gleap.registerCustomAction((customAction) => {
console.log("Custom action: ", customAction);
});
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export namespace Gleap {
email?: string;
phone?: string;
value?: number;
companyId?: string;
customData?: object;
},
userHash?: string
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": "12.0.3",
"version": "12.1.0",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
1 change: 1 addition & 0 deletions published/12.1.0/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.

65 changes: 65 additions & 0 deletions src/Gleap.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,71 @@ class Gleap {
GleapFrameManager.getInstance().showWidget();
}

/**
* Open the checklists overview.
*/
static openChecklists() {
GleapFrameManager.getInstance().setAppMode("widget");

GleapFrameManager.getInstance().sendMessage(
{
name: "open-checklists",
data: {},
},
true
);

GleapFrameManager.getInstance().showWidget();
}

/**
* Starts a new checklist and opens it.
*/
static startChecklist(outboundId) {
if (!outboundId) {
return false;
}

GleapFrameManager.getInstance().setAppMode("widget");

GleapFrameManager.getInstance().sendMessage(
{
name: "start-checklist",
data: {
outboundId: outboundId,
},
},
true
);

GleapFrameManager.getInstance().showWidget();

return true;
}

/**
* Open an existing checklist.
*/
static openChecklist(id) {
if (!id) {
return;
}

GleapFrameManager.getInstance().setAppMode("widget");

GleapFrameManager.getInstance().sendMessage(
{
name: "open-checklist",
data: {
id,
},
},
true
);

GleapFrameManager.getInstance().showWidget();
}

/**
* Opens the news overview.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/GleapNotificationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export default class GleapNotificationManager {
Gleap.openConversation(notification.data.conversation.shareToken);
} else if (notification.data.news) {
Gleap.openNewsArticle(notification.data.news.id);
} else if (notification.data.checklist) {
Gleap.openChecklist(notification.data.checklist.id);
} else {
Gleap.open();
}
Expand Down
2 changes: 1 addition & 1 deletion src/GleapStreamedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default class GleapStreamedEvent {

this.mainLoopTimeout = setTimeout(function () {
self.runEventStreamLoop();
}, 3000);
}, 1500);
};

streamEvents = () => {
Expand Down

0 comments on commit 446c47e

Please sign in to comment.