45 lines
896 B
Vue
45 lines
896 B
Vue
<template>
|
|
<div class="flex flex-1 items-center">
|
|
<div
|
|
v-if="integration"
|
|
class="hidden md:block space-y-1"
|
|
>
|
|
<UBadge
|
|
:label="integration.data.webhook_url"
|
|
color="gray"
|
|
size="xs"
|
|
class="max-w-[300px] block truncate"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
const props = defineProps({
|
|
integration: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
form: {
|
|
type: Object,
|
|
required: true,
|
|
}
|
|
})
|
|
|
|
const formIntegrationsStore = useFormIntegrationsStore()
|
|
let interval = null
|
|
|
|
onMounted(() => {
|
|
if (!props.integration.data || props.integration.data.length === 0) {
|
|
interval = setInterval(() => formIntegrationsStore.fetchFormIntegrations(props.form.id), 3000)
|
|
setTimeout(() => { clearInterval(interval) }, 30000)
|
|
}
|
|
})
|
|
|
|
onBeforeUnmount(() => {
|
|
if (interval) {
|
|
clearInterval(interval)
|
|
}
|
|
})
|
|
</script>
|