Skip to content

Commit

Permalink
Add error to message types (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonso-cadenas authored Feb 9, 2024
1 parent b64aa65 commit 3a7c5cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions demos/demo-minimal-js/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable import/no-relative-packages */
import CallingExtensions from "../../src/CallingExtensions";
import { errorType, callEndStatus } from "../../src/Constants";
import { messageType, callEndStatus } from "../../src/Constants";
// import CallingExtensions, { Constants } from "@hubspot/calling-extensions-sdk";
// const { errorType, callEndStatus } = Constants;
// const { messageType, callEndStatus } = Constants;

export const state = {
engagementId: 0,
Expand Down Expand Up @@ -225,7 +225,7 @@ export function completeCall() {

export function sendError() {
cti.sendError({
type: errorType.ERROR,
type: messageType.ERROR,
message: "This is an error alert shown in the Hubspot UI",
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const messageType = {
...thirdPartyToHostEvents,
...hostToThirdPartyEvents,
END_CALL: "END_CALL",
ERROR: "ERROR",
READY: "READY",
SET_CALL_STATE: "SET_CALL_STATE",
SET_WIDGET_URL: "SET_WIDGET_URL",
Expand Down Expand Up @@ -71,7 +72,6 @@ export const messageHandlerNames = {

export const errorType = {
UNKNOWN_MESSAGE_TYPE: "UNKNOWN_MESSAGE_TYPE",
ERROR: "ERROR",
};

/** These are potential statuses from the BE client when calling from phone
Expand Down

0 comments on commit 3a7c5cd

Please sign in to comment.