Revert "Enhance handleContactVisibility to return both title and message"
This reverts commit 97cb5a0ac6.
This commit is contained in:
@@ -770,8 +770,8 @@ export default class ContactsView extends Vue {
|
||||
// Update local contacts list
|
||||
this.updateContactsList(newContact);
|
||||
|
||||
// Set visibility and get success notification data
|
||||
const notificationData = await this.handleContactVisibility(newContact);
|
||||
// Set visibility and get success message
|
||||
const addedMessage = await this.handleContactVisibility(newContact);
|
||||
|
||||
// Clear input field
|
||||
this.contactInput = "";
|
||||
@@ -779,12 +779,8 @@ export default class ContactsView extends Vue {
|
||||
// Handle registration prompt if needed
|
||||
await this.handleRegistrationPrompt(newContact);
|
||||
|
||||
// Show success notification with custom title and message
|
||||
this.notify.toast(
|
||||
notificationData.title,
|
||||
notificationData.message,
|
||||
TIMEOUTS.STANDARD,
|
||||
);
|
||||
// Show success notification
|
||||
this.notify.success(addedMessage);
|
||||
} catch (err) {
|
||||
this.handleContactAddError(err);
|
||||
}
|
||||
@@ -817,23 +813,15 @@ export default class ContactsView extends Vue {
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle contact visibility settings and return appropriate notification data
|
||||
* Handle contact visibility settings and return appropriate message
|
||||
*/
|
||||
private async handleContactVisibility(
|
||||
newContact: Contact,
|
||||
): Promise<{ title: string; message: string }> {
|
||||
private async handleContactVisibility(newContact: Contact): Promise<string> {
|
||||
if (this.activeDid) {
|
||||
await this.setVisibility(newContact, true, false);
|
||||
newContact.seesMe = true;
|
||||
return {
|
||||
title: NOTIFY_CONTACTS_ADDED_VISIBLE.title,
|
||||
message: NOTIFY_CONTACTS_ADDED_VISIBLE.message,
|
||||
};
|
||||
return NOTIFY_CONTACTS_ADDED_VISIBLE.message;
|
||||
} else {
|
||||
return {
|
||||
title: NOTIFY_CONTACTS_ADDED.title,
|
||||
message: NOTIFY_CONTACTS_ADDED.message,
|
||||
};
|
||||
return NOTIFY_CONTACTS_ADDED.message;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user