diff --git a/demos/demo-minimal-js/index.js b/demos/demo-minimal-js/index.js index d9af43a..b9d8b5d 100644 --- a/demos/demo-minimal-js/index.js +++ b/demos/demo-minimal-js/index.js @@ -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, @@ -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", }); } diff --git a/src/Constants.js b/src/Constants.js index 5f5ce9a..b995104 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -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", @@ -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