From c93c6aed5f1beb6cc0b0f666a395fdf0ebfa7ed6 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 12 Jun 2025 14:13:39 +0530 Subject: [PATCH] fix: realtime events not working --- .../react-components/src/components/ChatwootProvider.jsx | 4 ++-- .../src/vue-components/registerWebComponents.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/javascript/react-components/src/components/ChatwootProvider.jsx b/app/javascript/react-components/src/components/ChatwootProvider.jsx index b7255a516..90600889f 100644 --- a/app/javascript/react-components/src/components/ChatwootProvider.jsx +++ b/app/javascript/react-components/src/components/ChatwootProvider.jsx @@ -35,8 +35,8 @@ export const ChatwootProvider = ({ const config = { baseURL: baseURL.replace(/\/$/, ''), // Remove trailing slash userToken, - accountId, - conversationId, + accountId: Number(accountId), + conversationId: Number(conversationId), disableEditor: disableEditor || false, disableUpload: disableUpload || false, websocketURL: websocketURL, diff --git a/app/javascript/react-components/src/vue-components/registerWebComponents.js b/app/javascript/react-components/src/vue-components/registerWebComponents.js index 8a8f0bb7a..874af8b9a 100644 --- a/app/javascript/react-components/src/vue-components/registerWebComponents.js +++ b/app/javascript/react-components/src/vue-components/registerWebComponents.js @@ -3,6 +3,7 @@ import ChatwootMessageListWebComponent from './ChatwootMessageListWebComponent.v import '../../../dashboard/assets/scss/app.scss'; import en from '../../../dashboard/i18n/locale/en'; import store from '../../../dashboard/store'; +import vueActionCable from '../../../dashboard/helper/actionCable'; import { createI18n, I18nInjectionKey } from 'vue-i18n'; import VueDOMPurifyHTML from 'vue-dompurify-html'; @@ -27,6 +28,8 @@ const ceOptions = { // Adding this link for my goldfish brain app.use(i18n); app.provide(I18nInjectionKey, i18n); + // eslint-disable-next-line no-underscore-dangle + vueActionCable.init(store, window.__PUBSUB_TOKEN__); }, };