@ -195,7 +195,7 @@ export default class ContactGiftingView extends Vue {
let giver : GiverReceiverInputInfo | undefined ;
let giver : GiverReceiverInputInfo | undefined ;
if ( this . stepType === "giver" ) {
if ( this . stepType === "giver" ) {
/ / W e ' r e s e l e c t i n g a g i v e r , s o r e c i p i e n t i s e i t h e r a p r o j e c t o r t h e c u r r e n t u s e r
/ / W e ' r e s e l e c t i n g a g i v e r , s o p r e s e r v e t h e e x i s t i n g r e c i p i e n t f r o m c o n t e x t
if ( this . recipientEntityType === "project" ) {
if ( this . recipientEntityType === "project" ) {
recipient = {
recipient = {
did : this . recipientProjectHandleId ,
did : this . recipientProjectHandleId ,
@ -204,8 +204,21 @@ export default class ContactGiftingView extends Vue {
handleId : this . recipientProjectHandleId ,
handleId : this . recipientProjectHandleId ,
} ;
} ;
} else {
} else {
/ / P r e s e r v e t h e e x i s t i n g r e c i p i e n t f r o m c o n t e x t
if ( this . recipientDid === this . activeDid ) {
/ / R e c i p i e n t w a s " Y o u "
recipient = { did : this . activeDid , name : "You" } ;
} else if ( this . recipientDid ) {
/ / R e c i p i e n t w a s a r e g u l a r c o n t a c t
recipient = {
did : this . recipientDid ,
name : this . recipientProjectName || "Someone" ,
} ;
} else {
/ / F a l l b a c k t o " Y o u " i f n o r e c i p i e n t w a s p r e v i o u s l y s e l e c t e d
recipient = { did : this . activeDid , name : "You" } ;
recipient = { did : this . activeDid , name : "You" } ;
}
}
}
giver = undefined ; / / W i l l b e s e t t o " U n n a m e d " i n G i f t e d D i a l o g
giver = undefined ; / / W i l l b e s e t t o " U n n a m e d " i n G i f t e d D i a l o g
} else {
} else {
/ / W e ' r e s e l e c t i n g a r e c i p i e n t , s o r e c i p i e n t i s " U n n a m e d " a n d g i v e r i s p r e s e r v e d f r o m c o n t e x t
/ / W e ' r e s e l e c t i n g a r e c i p i e n t , s o r e c i p i e n t i s " U n n a m e d " a n d g i v e r i s p r e s e r v e d f r o m c o n t e x t
@ -239,12 +252,8 @@ export default class ContactGiftingView extends Vue {
this . unitCode ,
this . unitCode ,
) ;
) ;
/ / I m m e d i a t e l y s e l e c t " U n n a m e d " a n d m o v e t o S t e p 2 b a s e d o n s t e p T y p e
/ / M o v e t o S t e p 2 - e n t i t i e s a r e a l r e a d y s e t b y t h e o p e n ( ) c a l l
if ( this . stepType === "giver" ) {
( this . $refs . giftedDialog as GiftedDialog ) . moveToStep2 ( ) ;
( this . $refs . giftedDialog as GiftedDialog ) . selectGiver ( ) ;
} else {
( this . $refs . giftedDialog as GiftedDialog ) . selectRecipient ( ) ;
}
} else {
} else {
/ / R e g u l a r c a s e : c o n t a c t i s a G i v e r R e c e i v e r I n p u t I n f o
/ / R e g u l a r c a s e : c o n t a c t i s a G i v e r R e c e i v e r I n p u t I n f o
let giver : GiverReceiverInputInfo ;
let giver : GiverReceiverInputInfo ;
@ -317,6 +326,9 @@ export default class ContactGiftingView extends Vue {
this . amountInput ,
this . amountInput ,
this . unitCode ,
this . unitCode ,
) ;
) ;
/ / M o v e t o S t e p 2 - e n t i t i e s a r e a l r e a d y s e t b y t h e o p e n ( ) c a l l
( this . $refs . giftedDialog as GiftedDialog ) . moveToStep2 ( ) ;
}
}
}
}
}
}