File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
app/code/Magento/Paypal/view/frontend/web/js/in-context Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,18 @@ define([
18
18
/** @inheritdoc */
19
19
initialize : function ( config , element ) {
20
20
var cart = customerData . get ( 'cart' ) ,
21
- customer = customerData . get ( 'customer' ) ;
21
+ customer = customerData . get ( 'customer' ) ,
22
+ updateDeclinePayment = function ( ) {
23
+ this . declinePayment = ! customer ( ) . firstname && ! cart ( ) . isGuestCheckoutAllowed ;
24
+ } . bind ( this ) ;
22
25
23
26
this . _super ( ) ;
24
27
this . renderPayPalButtons ( element ) ;
25
- this . declinePayment = ! customer ( ) . firstname && ! cart ( ) . isGuestCheckoutAllowed ;
28
+
29
+ updateDeclinePayment ( ) ;
30
+
31
+ cart . subscribe ( updateDeclinePayment ) ;
32
+ customer . subscribe ( updateDeclinePayment ) ;
26
33
27
34
return this ;
28
35
} ,
You can’t perform that action at this time.
0 commit comments