From 6dfc5ef2f5e95c7965ec25fb1772be0b2d6ea850 Mon Sep 17 00:00:00 2001 From: Davide Negretti Date: Fri, 9 Sep 2022 17:04:01 +0200 Subject: [PATCH] [UXP-10] Handle captcha expiration --- .../google-recaptcha.component.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/shared/google-recaptcha/google-recaptcha.component.ts b/src/app/shared/google-recaptcha/google-recaptcha.component.ts index 265ee96e02..6c3bb85808 100644 --- a/src/app/shared/google-recaptcha/google-recaptcha.component.ts +++ b/src/app/shared/google-recaptcha/google-recaptcha.component.ts @@ -40,8 +40,8 @@ export class GoogleRecaptchaComponent implements OnInit { getFirstSucceededRemoteDataPayload(), ); this._window.nativeWindow.dataCallback = this.dataCallbackFcn; - this._window.nativeWindow.expiredCallback = this.notificationFcn('expired'); - this._window.nativeWindow.errorCallback = this.notificationFcn('error'); + this._window.nativeWindow.expiredCallback = this.expiredCallbackFcn; + this._window.nativeWindow.errorCallback = this.errorCallbackFcn; } dataCallbackFcn = ($event) => { @@ -59,10 +59,13 @@ export class GoogleRecaptchaComponent implements OnInit { } }; - notificationFcn(key) { - return () => { - this.showNotification.emit(key); - }; - } + expiredCallbackFcn = () => { + this.checkboxChecked.emit(false); + this.showNotification.emit('expired'); + }; + + errorCallbackFcn = () => { + this.showNotification.emit('error'); + }; }