Skip to content

Commit

Permalink
fix: chat reinit [WTEL-4041]
Browse files Browse the repository at this point in the history
  • Loading branch information
dlohvinov committed Nov 10, 2023
1 parent 1a83d5e commit bda25f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/modules/chat/components/wt-omni-widget-chat-wrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ why there's d: contents; and this weird wrapper?

<script>
import eventBus from '@webitel/ui-sdk/src/scripts/eventBus';
import { mapActions } from 'vuex';
import { mapActions, mapState } from 'vuex';
import ContentWrapper
from '../../../app/components/wt-omni-widget-window/wt-omni-widget-window-content-wrapper/wt-omni-widget-window-content-wrapper.vue';
import FooterWrapper
Expand All @@ -40,6 +40,11 @@ export default {
required: true,
},
},
computed: {
...mapState('chat', {
client: state => state.messageClient,
}),
},
methods: {
...mapActions({
initializeSession: 'INITIALIZE_SESSION',
Expand All @@ -50,6 +55,7 @@ export default {
onMessage: 'ON_MESSAGE',
}),
initSession() {
if (this.client) return; // prevent reinitialization, but should be refactored
const workerSupport = false && !!window.SharedWorker && !!window.BroadcastChannel; // FIXME
const messageClient = new MessageClient({
url: this.config.chat.url,
Expand Down

0 comments on commit bda25f7

Please sign in to comment.