From 2dbc9a3b99ba75ec463ea23da4a6b54b1c468f9f Mon Sep 17 00:00:00 2001 From: Daniil Lohvinov Date: Wed, 13 Mar 2024 10:03:58 +0200 Subject: [PATCH] fix: recaptchify usage [WTEL-4251] --- .../appointment/components/wt-omni-widget-appointment.vue | 5 ++--- src/modules/chat/components/wt-omni-widget-chat-wrapper.vue | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modules/appointment/components/wt-omni-widget-appointment.vue b/src/modules/appointment/components/wt-omni-widget-appointment.vue index 4dd304b..be90fbb 100644 --- a/src/modules/appointment/components/wt-omni-widget-appointment.vue +++ b/src/modules/appointment/components/wt-omni-widget-appointment.vue @@ -43,14 +43,13 @@ export default { }, async created() { try { - (await reCAPTCHify(() => { - this.loadAppointmentData(); - }))(); + await reCAPTCHify(this.loadAppointmentData); } catch (err) { eventBus.$emit('snack', { type: 'error', text: this.$t('captcha.error.text'), }); + throw err; } }, }; diff --git a/src/modules/chat/components/wt-omni-widget-chat-wrapper.vue b/src/modules/chat/components/wt-omni-widget-chat-wrapper.vue index d7fa0d1..e04a315 100644 --- a/src/modules/chat/components/wt-omni-widget-chat-wrapper.vue +++ b/src/modules/chat/components/wt-omni-widget-chat-wrapper.vue @@ -58,7 +58,7 @@ export default { async initSession() { if (this.client) return; // prevent reinitialization, but should be refactored try { - (await reCAPTCHify(() => { + await reCAPTCHify(() => { const workerSupport = false && !!window.SharedWorker && !!window.BroadcastChannel; // FIXME const messageClient = new MessageClient({ url: this.config.chat.url, @@ -71,7 +71,7 @@ export default { await this.closeSession(); delete e.returnValue; // page will always reload }); - }))(); + }); } catch (err) { eventBus.$emit('snack', { type: 'error',