Browse Source

Revert "Enhance handleContactVisibility to return both title and message"

This reverts commit 97cb5a0ac6.
pull/142/head
Jose Olarte III 5 days ago
parent
commit
3cf75c5dbe
  1. 28
      src/views/ContactsView.vue

28
src/views/ContactsView.vue

@ -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;
}
}

Loading…
Cancel
Save