@@ -548,25 +548,23 @@ const handleAppAction = (action) => {
548
548
}
549
549
appState = appState . setIn ( [ 'autofill' , 'addresses' ] ,
550
550
appState . getIn ( [ 'autofill' , 'addresses' ] ) . filterNot ( ( address ) => {
551
- return Immutable . is ( address , action . originalDetail )
551
+ return Immutable . is ( address , action . originalDetail . get ( 'guid' ) )
552
552
} ) )
553
- if ( action . originalDetail . toJS ( ) . guid !== undefined ) {
554
- Filtering . removeAutofillAddress ( action . originalDetail . toJS ( ) . guid )
553
+ if ( action . originalDetail . get ( ' guid' ) !== undefined ) {
554
+ Filtering . removeAutofillAddress ( action . originalDetail . get ( ' guid' ) )
555
555
}
556
556
557
557
let addresses = appState . getIn ( [ 'autofill' , 'addresses' ] )
558
558
const guid = Filtering . addAutofillAddress ( action . detail . toJS ( ) )
559
- let detail = action . detail
560
- detail = detail . set ( 'guid' , Immutable . fromJS ( guid ) )
561
- appState = appState . setIn ( [ 'autofill' , 'addresses' ] , addresses . push ( Immutable . fromJS ( detail ) ) )
559
+ appState = appState . setIn ( [ 'autofill' , 'addresses' ] , addresses . push ( Immutable . fromJS ( guid ) ) )
562
560
break
563
561
}
564
562
case AppConstants . APP_REMOVE_AUTOFILL_ADDRESS :
565
563
{
566
564
const Filtering = require ( '../../app/filtering' )
567
565
appState = appState . setIn ( [ 'autofill' , 'addresses' ] ,
568
566
appState . getIn ( [ 'autofill' , 'addresses' ] ) . filterNot ( ( address ) => {
569
- return Immutable . is ( address , Immutable . fromJS ( action . detail ) )
567
+ return Immutable . is ( address , Immutable . fromJS ( action . detail . guid ) )
570
568
} ) )
571
569
Filtering . removeAutofillAddress ( action . detail . guid )
572
570
break
@@ -579,25 +577,23 @@ const handleAppAction = (action) => {
579
577
}
580
578
appState = appState . setIn ( [ 'autofill' , 'creditCards' ] ,
581
579
appState . getIn ( [ 'autofill' , 'creditCards' ] ) . filterNot ( ( card ) => {
582
- return Immutable . is ( card , action . originalDetail )
580
+ return Immutable . is ( card , action . originalDetail . get ( 'guid' ) )
583
581
} ) )
584
- if ( action . originalDetail . toJS ( ) . guid !== undefined ) {
585
- Filtering . removeAutofillCreditCard ( action . originalDetail . toJS ( ) . guid )
582
+ if ( action . originalDetail . get ( ' guid' ) !== undefined ) {
583
+ Filtering . removeAutofillCreditCard ( action . originalDetail . get ( ' guid' ) )
586
584
}
587
585
588
586
let creditCards = appState . getIn ( [ 'autofill' , 'creditCards' ] )
589
587
const guid = Filtering . addAutofillCreditCard ( action . detail . toJS ( ) )
590
- let detail = action . detail
591
- detail = detail . set ( 'guid' , Immutable . fromJS ( guid ) )
592
- appState = appState . setIn ( [ 'autofill' , 'creditCards' ] , creditCards . push ( Immutable . fromJS ( detail ) ) )
588
+ appState = appState . setIn ( [ 'autofill' , 'creditCards' ] , creditCards . push ( Immutable . fromJS ( guid ) ) )
593
589
break
594
590
}
595
591
case AppConstants . APP_REMOVE_AUTOFILL_CREDIT_CARD :
596
592
{
597
593
const Filtering = require ( '../../app/filtering' )
598
594
appState = appState . setIn ( [ 'autofill' , 'creditCards' ] ,
599
595
appState . getIn ( [ 'autofill' , 'creditCards' ] ) . filterNot ( ( card ) => {
600
- return Immutable . is ( card , Immutable . fromJS ( action . detail ) )
596
+ return Immutable . is ( card , Immutable . fromJS ( action . detail . guid ) )
601
597
} ) )
602
598
Filtering . removeAutofillCreditCard ( action . detail . guid )
603
599
break
0 commit comments