From 1abb04f592f8b9fc920a4d91f1afba3895c45a61 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 7 May 2025 22:24:27 +0530 Subject: [PATCH] feat: update ui.js --- app/javascript/dashboard/composables/store.js | 6 ++++++ app/javascript/entrypoints/ui.js | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/javascript/dashboard/composables/store.js b/app/javascript/dashboard/composables/store.js index e3ca187e2..3b5f9d746 100644 --- a/app/javascript/dashboard/composables/store.js +++ b/app/javascript/dashboard/composables/store.js @@ -2,6 +2,12 @@ import { computed, unref } from 'vue'; import { getCurrentInstance } from 'vue'; export const useStore = () => { + // eslint-disable-next-line no-underscore-dangle + if (window.__CHATWOOT_STORE__) { + // eslint-disable-next-line no-underscore-dangle + return window.__CHATWOOT_STORE__; + } + const vm = getCurrentInstance(); if (!vm) throw new Error('must be called in setup'); return vm.proxy.$store; diff --git a/app/javascript/entrypoints/ui.js b/app/javascript/entrypoints/ui.js index d18521326..a6a01e89d 100644 --- a/app/javascript/entrypoints/ui.js +++ b/app/javascript/entrypoints/ui.js @@ -11,15 +11,18 @@ import createAxios from 'dashboard/helper/APIHelper'; import commonHelpers from 'dashboard/helper/commons'; import ChatButton from '../ui/ChatButton.vue'; +import WootInput from '../dashboard/components-next/input/Input.vue'; commonHelpers(); window.WootConstants = constants; window.axios = createAxios(axios); export const buttonElement = defineCustomElement(ChatButton); +export const inputElement = defineCustomElement(WootInput); // eslint-disable-next-line no-underscore-dangle window.__CHATWOOT_STORE__ = store; -customElements.define('chat-button', buttonElement); +customElements.define('woot-button', buttonElement); +customElements.define('woot-input', inputElement); export { store, ChatButton };