@@ -15,8 +15,8 @@ export default Component.extend(FormMixin, {
1515 && ! this . get ( 'authManager.currentUser.isVerified' ) ;
1616 } ) ,
1717
18- shouldDisableOrderButton : computed ( 'hasTicketsInOrder' , 'donationPriceValid ' , function ( ) {
19- return ! this . hasTicketsInOrder || ! this . donationPriceValid ;
18+ shouldDisableOrderButton : computed ( 'hasTicketsInOrder' , 'isDonationPriceValid ' , function ( ) {
19+ return ! ( this . hasTicketsInOrder && this . isDonationPriceValid ) ;
2020 } ) ,
2121
2222 showTaxIncludedMessage : computed ( 'taxInfo.isTaxIncludedInPrice' , function ( ) {
@@ -40,23 +40,22 @@ export default Component.extend(FormMixin, {
4040 ) > 0 ;
4141 } ) ,
4242
43- donationTickets : computed ( 'tickets ' , function ( ) {
44- return this . tickets . filterBy ( 'type' , 'donation' ) ;
43+ donationTickets : computed ( 'data ' , function ( ) {
44+ return this . data . filterBy ( 'type' , 'donation' ) ;
4545 } ) ,
4646
4747 isDonationPriceValid :
computed ( 'donationTickets' , '[email protected] ' , '[email protected] ' , function ( ) { 48- if ( this . donationTickets ) {
49- this . donationTickets . forEach ( donationTicket => {
50- if ( donationTicket . orderQuantity >= 0 ) {
51- if ( donationTicket . price > 0 ) {
52- return true ;
53- } else {
54- return false ;
55- }
48+ let returnValue = false ;
49+ this . donationTickets . forEach ( donationTicket => {
50+ if ( donationTicket . get ( 'orderQuantity' ) >= 0 ) {
51+ if ( donationTicket . get ( 'price' ) > 0 ) {
52+ returnValue = true ;
53+ } else {
54+ returnValue = false ;
5655 }
57- } ) ;
58- }
59- return true ;
56+ }
57+ } ) ;
58+ return returnValue ;
6059 } ) ,
6160
6261 total :
computed ( '[email protected] ' , '[email protected] ' , function ( ) {
0 commit comments