diff --git a/src/App.vue b/src/App.vue index 422ae2893..3d7d6dd2f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,6 +7,7 @@ + diff --git a/src/helpers/webchat-helper.js b/src/helpers/webchat-helper.js new file mode 100644 index 000000000..c2cbdecbf --- /dev/null +++ b/src/helpers/webchat-helper.js @@ -0,0 +1,20 @@ +import { reactive } from "vue"; + +// state encapsulated and managed by the composable +const webchatGlobalNonpersistedState = reactive({ + showWebchatButton: false, + shouldLaunchSierra: false, +}); + +export const webchatHelper = () => { + + function launchWebchat() { + if (webchatGlobalNonpersistedState.shouldLaunchSierra) { + // do sierra logic here + } else { + window.embedded_svc.bootstrapEmbeddedService(); // launches the salesForce prechat form + } + } + + return { webchatGlobalNonpersistedState, launchWebchat }; +}; diff --git a/src/store/index.js b/src/store/index.js index 753d8509b..88fa12baf 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -55,7 +55,6 @@ import { } from "@/helpers/recal-helper"; import { externalParameterStatus } from "@/constants/external-parameters"; import { experimentSettings } from "@/constants/experiments"; -import experimentMixin from "@/mixins/experiment-mixin.js"; // Export State const getDefaultState = () => {