diff --git a/app/pages/captioner.vue b/app/pages/captioner.vue index 89c869c..0324bf0 100755 --- a/app/pages/captioner.vue +++ b/app/pages/captioner.vue @@ -214,32 +214,17 @@ export default { this.$store.dispatch('share/CHECK_LINK_EXPIRY'); let lastWebhookEventDate = 0; + let sequence = 0; let callWebhook = ({ url, method, transcript }) => { transcript = (transcript || '').toUpperCase(); - // this.$store.commit('APPEND_WEBHOOK_LOG', { - // event: { - // type: 'send', - // title: method + ' ' + url, - // body: JSON.stringify({transcript}), - // showBody: false, - // } - // }); - - // this.$socket.sendObj({ - // action: 'callWebhook', - // url, - // method, - // transcript, - // }); - fetch(url, { method, mode: 'cors', headers: { Accept: 'application/json', }, - body: JSON.stringify({ transcript }), + body: JSON.stringify({ transcript, sequence }), }) .then((response) => { response.text().then(() => { @@ -261,12 +246,12 @@ export default { }, }); }); + sequence++; }; RemoteEventBus.$on('sendMutationToReceivers', ({ mutation, payload }) => { if ( this.$store.state.settings.integrations.webhooks.on && mutation === 'captioner/APPEND_TRANSCRIPT_STABILIZED' - // && (Date.now() - lastWebhookEventDate) >= this.$store.state.settings.integrations.webhooks.throttleMs ) { callWebhook({ url: this.$store.state.settings.integrations.webhooks.url, diff --git a/app/pages/captioner/settings/webhooks/index.vue b/app/pages/captioner/settings/webhooks/index.vue index 4ebe434..b049129 100755 --- a/app/pages/captioner/settings/webhooks/index.vue +++ b/app/pages/captioner/settings/webhooks/index.vue @@ -118,9 +118,18 @@
{ - "transcript": "This is a transcript" + transcript: "Hello", + sequence: 2 }