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 // Update local contacts list
this.updateContactsList(newContact); this.updateContactsList(newContact);
// Set visibility and get success notification data // Set visibility and get success message
const notificationData = await this.handleContactVisibility(newContact); const addedMessage = await this.handleContactVisibility(newContact);
// Clear input field // Clear input field
this.contactInput = ""; this.contactInput = "";
@ -779,12 +779,8 @@ export default class ContactsView extends Vue {
// Handle registration prompt if needed // Handle registration prompt if needed
await this.handleRegistrationPrompt(newContact); await this.handleRegistrationPrompt(newContact);
// Show success notification with custom title and message // Show success notification
this.notify.toast( this.notify.success(addedMessage);
notificationData.title,
notificationData.message,
TIMEOUTS.STANDARD,
);
} catch (err) { } catch (err) {
this.handleContactAddError(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( private async handleContactVisibility(newContact: Contact): Promise<string> {
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 { return NOTIFY_CONTACTS_ADDED_VISIBLE.message;
title: NOTIFY_CONTACTS_ADDED_VISIBLE.title,
message: NOTIFY_CONTACTS_ADDED_VISIBLE.message,
};
} else { } else {
return { return NOTIFY_CONTACTS_ADDED.message;
title: NOTIFY_CONTACTS_ADDED.title,
message: NOTIFY_CONTACTS_ADDED.message,
};
} }
} }

Loading…
Cancel
Save