diff --git a/src/components/contacts/ContactDropDownMenu.vue b/src/components/contacts/ContactDropDownMenu.vue index 5740dbc..b00e266 100644 --- a/src/components/contacts/ContactDropDownMenu.vue +++ b/src/components/contacts/ContactDropDownMenu.vue @@ -33,6 +33,14 @@ Copy Public Key + + + + + + Share (Zero Hop Advert) + + @@ -87,6 +95,15 @@ export default { copyPublicKey(contact) { Utils.copyToClipboard(Utils.bytesToHex(contact.publicKey)); }, + async shareContact(contact) { + try { + await Connection.shareContact(contact.publicKey); + alert("Contact has been adverted!"); + } catch(e) { + console.log(e); + alert("Failed to share this contact!"); + } + }, async onResetPath(contact) { // confirm user wants to reset path diff --git a/src/js/Connection.js b/src/js/Connection.js index 839b034..67bcc37 100644 --- a/src/js/Connection.js +++ b/src/js/Connection.js @@ -191,6 +191,10 @@ class Connection { await GlobalState.connection.sendCommandRemoveContact(publicKey); } + static async shareContact(publicKey) { + await GlobalState.connection.shareContact(publicKey); + } + static async sendMessage(publicKey, text) { // send message