Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The widget is not displayed in customer details #33

Open
MARSZOZO opened this issue Feb 27, 2025 · 2 comments
Open

The widget is not displayed in customer details #33

MARSZOZO opened this issue Feb 27, 2025 · 2 comments

Comments

@MARSZOZO
Copy link

MARSZOZO commented Feb 27, 2025

I created a test widget in addition to the current ones which work great. But it only works as a separate application in a tab. But it is not displayed in customer details. But my test widget displays perfectly in the archives... What's wrong?

Here's an example

  <div>
    <h1>{{ customerProfile }}</h1>
  </div>
</template>

<script lang="ts" setup>
import { onMounted, onUnmounted, ref, watch } from 'vue';
import { createDetailsWidget } from '@livechat/agent-app-sdk';

const widget = ref<any>(null);
const customerProfile = ref(null);

onMounted(async () => {
  widget.value = await createDetailsWidget();
});

watch(widget, (newWidget) => {
  if (newWidget) {
    customerProfile.value = newWidget.getCustomerProfile();

    newWidget.on('customer_profile', (profile) => {
      customerProfile.value = profile;
      console.log('Customer profile:', profile);
    });
  }
});

onUnmounted(() => {
  if (widget.value) {
    widget.value.off('customer_profile', customerProfile.value);
  }
});
</script>

Here is an example display

Image

@MARSZOZO
Copy link
Author

@lwojciechowski Do you have any comments on this point?

@MARSZOZO
Copy link
Author

@bolchowka @patrycja @aPoCoMiLogin @lwojciechowski
I need your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant