19 lines
569 B
JavaScript
19 lines
569 B
JavaScript
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 };
|
|
};
|