From e9b99a58110dbea3e82c66325e871f1f20b6e92c Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 11 Jun 2025 18:09:08 +0530 Subject: [PATCH] fix: uploads --- .../src/components/ChatwootProvider.jsx | 4 ++- .../ChatwootMessageListWebComponent.vue | 36 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/app/javascript/react-components/src/components/ChatwootProvider.jsx b/app/javascript/react-components/src/components/ChatwootProvider.jsx index 7b275c5bf..68170a774 100644 --- a/app/javascript/react-components/src/components/ChatwootProvider.jsx +++ b/app/javascript/react-components/src/components/ChatwootProvider.jsx @@ -16,6 +16,7 @@ export const ChatwootProvider = ({ websocketURL, pubsubToken, conversationId, + disableUpload, children, }) => { const isInitialized = useRef(false); @@ -35,6 +36,7 @@ export const ChatwootProvider = ({ userToken, accountId, conversationId, + disableUpload: disableUpload || false, websocketURL: websocketURL, pubsubToken: pubsubToken, }; @@ -51,8 +53,8 @@ export const ChatwootProvider = ({ window.__WEBSOCKET_URL__ = config.websocketURL; window.__PUBSUB_TOKEN__ = config.pubsubToken; window.__WOOT_CONVERSATION_ID__ = config.conversationId; + window.__EDITOR_DISABLE_UPLOAD__ = config.disableUpload; window.__WOOT_ISOLATED_SHELL__ = true; - window.__EDITOR_DISABLE_UPLOAD__ = true; /* eslint-enable no-underscore-dangle */ // Initialize common helpers diff --git a/app/javascript/react-components/src/vue-components/ChatwootMessageListWebComponent.vue b/app/javascript/react-components/src/vue-components/ChatwootMessageListWebComponent.vue index 56d2ce6e6..23659139d 100644 --- a/app/javascript/react-components/src/vue-components/ChatwootMessageListWebComponent.vue +++ b/app/javascript/react-components/src/vue-components/ChatwootMessageListWebComponent.vue @@ -10,4 +10,40 @@ import MessageList from '../../../ui/MessageList.vue'; @import '../../../dashboard/assets/scss/app.scss'; @import 'vue-multiselect/dist/vue-multiselect.css'; @import 'floating-vue/dist/style.css'; + +.file-uploads { + overflow: hidden; + position: relative; + text-align: center; + display: inline-block; +} + +.file-uploads.file-uploads-html4 input, +.file-uploads.file-uploads-html5 label { + /* background fix ie click */ + background: #fff; + opacity: 0; + font-size: 20em; + z-index: 1; + top: 0; + left: 0; + right: 0; + bottom: 0; + position: absolute; + width: 100%; + height: 100%; +} + +.file-uploads.file-uploads-html5 input, +.file-uploads.file-uploads-html4 label { + /* background fix ie click */ + position: absolute; + background: rgba(255, 255, 255, 0); + overflow: hidden; + position: fixed; + width: 1px; + height: 1px; + z-index: -1; + opacity: 0; +}