@ -770,8 +770,8 @@ export default class ContactsView extends Vue {
/ / U p d a t e l o c a l c o n t a c t s l i s t
/ / U p d a t e l o c a l c o n t a c t s l i s t
this . updateContactsList ( newContact ) ;
this . updateContactsList ( newContact ) ;
/ / S e t v i s i b i l i t y a n d g e t s u c c e s s m e s s a g e
/ / S e t v i s i b i l i t y a n d g e t s u c c e s s n o t i f i c a t i o n d a t a
const addedMessage = await this . handleContactVisibility ( newContact ) ;
const notificationData = await this . handleContactVisibility ( newContact ) ;
/ / C l e a r i n p u t f i e l d
/ / C l e a r i n p u t f i e l d
this . contactInput = "" ;
this . contactInput = "" ;
@ -779,8 +779,12 @@ export default class ContactsView extends Vue {
/ / H a n d l e r e g i s t r a t i o n p r o m p t i f n e e d e d
/ / H a n d l e r e g i s t r a t i o n p r o m p t i f n e e d e d
await this . handleRegistrationPrompt ( newContact ) ;
await this . handleRegistrationPrompt ( newContact ) ;
/ / S h o w s u c c e s s n o t i f i c a t i o n
/ / S h o w s u c c e s s n o t i f i c a t i o n w i t h c u s t o m t i t l e a n d m e s s a g e
this . notify . success ( addedMessage ) ;
this . notify . toast (
notificationData . title ,
notificationData . message ,
TIMEOUTS . STANDARD ,
) ;
} catch ( err ) {
} catch ( err ) {
this . handleContactAddError ( err ) ;
this . handleContactAddError ( err ) ;
}
}
@ -813,15 +817,23 @@ export default class ContactsView extends Vue {
}
}
/ * *
/ * *
* Handle contact visibility settings and return appropriate message
* Handle contact visibility settings and return appropriate notification data
* /
* /
private async handleContactVisibility ( newContact : Contact ) : Promise < string > {
private async handleContactVisibility (
newContact : Contact ,
) : Promise < { title : string ; message : string } > {
if ( this . activeDid ) {
if ( this . activeDid ) {
await this . setVisibility ( newContact , true , false ) ;
await this . setVisibility ( newContact , true , false ) ;
newContact . seesMe = true ;
newContact . seesMe = true ;
return NOTIFY_CONTACTS_ADDED_VISIBLE . message ;
return {
title : NOTIFY_CONTACTS_ADDED_VISIBLE . title ,
message : NOTIFY_CONTACTS_ADDED_VISIBLE . message ,
} ;
} else {
} else {
return NOTIFY_CONTACTS_ADDED . message ;
return {
title : NOTIFY_CONTACTS_ADDED . title ,
message : NOTIFY_CONTACTS_ADDED . message ,
} ;
}
}
}
}