@@ -68,10 +68,33 @@ export default Component.extend({
6868
6969 setEventListeners ( ) {
7070 let stripeElement = get ( this , 'stripeElement' ) ;
71- stripeElement . on ( 'ready' , ( event ) => this . ready ( stripeElement , event ) ) ;
72- stripeElement . on ( 'blur' , ( event ) => this . blur ( stripeElement , event ) ) ;
73- stripeElement . on ( 'focus' , ( event ) => this . focus ( stripeElement , event ) ) ;
71+
72+ stripeElement . on ( 'ready' , ( event ) => {
73+ if ( this . isDestroying || this . isDestroyed ) {
74+ return ;
75+ }
76+ this . sendAction ( 'ready' , stripeElement , event ) ;
77+ } ) ;
78+
79+ stripeElement . on ( 'blur' , ( event ) => {
80+ if ( this . isDestroying || this . isDestroyed ) {
81+ return ;
82+ }
83+ this . sendAction ( 'blur' , stripeElement , event )
84+ } ) ;
85+
86+ stripeElement . on ( 'focus' , ( event ) => {
87+ if ( this . isDestroying || this . isDestroyed ) {
88+ return ;
89+ }
90+ this . sendAction ( 'focus' , stripeElement , event )
91+ } ) ;
92+
7493 stripeElement . on ( 'change' , ( ...args ) => {
94+ if ( this . isDestroying || this . isDestroyed ) {
95+ return ;
96+ }
97+
7598 let [ { complete, error : stripeError } ] = args ;
7699 this . change ( stripeElement , ...args ) ;
77100
0 commit comments