Commit f43a5db 1 parent e8642bb commit f43a5db Copy full SHA for f43a5db
File tree 2 files changed +7
-5
lines changed
components/easycredit-checkout
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,12 @@ export class EasycreditCheckout {
26
26
@State ( ) selectedInstallment : InstallmentPlan = null
27
27
@State ( ) submitDisabled = false
28
28
29
+ @Element ( ) el : HTMLElement ;
30
+
29
31
modal ! : HTMLEasycreditModalElement ;
30
32
31
33
caps : Caps
34
+ errorHandlerTimeout : number
32
35
33
36
@Listen ( 'selectedInstallment' )
34
37
selectedInstallmentHandler ( e ) {
@@ -43,6 +46,7 @@ export class EasycreditCheckout {
43
46
@Listen ( 'closeModal' )
44
47
closeModalHandler ( ) {
45
48
this . modal . close ( )
49
+ clearTimeout ( this . errorHandlerTimeout ) ;
46
50
}
47
51
48
52
isEnabled ( type : METHODS ) {
@@ -79,13 +83,11 @@ export class EasycreditCheckout {
79
83
}
80
84
}
81
85
82
- @Element ( ) el : HTMLElement ;
83
-
84
86
submitHandler ( ) {
85
87
sendFeedback ( this , { component : 'EasycreditCheckout' , action : 'submit' } )
86
88
87
89
this . submitButtonClicked = true
88
- addErrorHandler ( this , ( ) => {
90
+ this . errorHandlerTimeout = addErrorHandler ( this , ( ) => {
89
91
this . alert = 'Leider ist eine Zahlung mit easyCredit derzeit nicht möglich. Bitte verwenden Sie eine andere Zahlungsart oder wenden Sie sich an den Händler.'
90
92
this . modal . close ( )
91
93
} )
Original file line number Diff line number Diff line change 1
1
import { Loader } from './loader'
2
2
import { InstallmentPlans , InstallmentPlansContainer } from '../types'
3
3
4
- export function addErrorHandler ( component , callback ) {
4
+ export function addErrorHandler ( component , callback ) : number {
5
5
let time = 10
6
6
7
- let timeout = window . setTimeout ( ( ) => {
7
+ const timeout : number = window . setTimeout ( ( ) => {
8
8
console . error ( 'No event handler handled the submit event of <easycredit-checkout> within ' + time + ' seconds. Please check the integration.' )
9
9
sendFeedback ( component , { component : 'EasycreditCheckout' , action : 'error' } )
10
10
You can’t perform that action at this time.
0 commit comments