From 24fec964de8da0542b7417ef4c0e7c3caa8b4bc4 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Thu, 13 Feb 2025 01:31:20 +1300 Subject: [PATCH] add button to reset path --- src/components/contacts/ContactDropDownMenu.vue | 15 +++++++++++++++ src/js/Connection.js | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/src/components/contacts/ContactDropDownMenu.vue b/src/components/contacts/ContactDropDownMenu.vue index 803590e..6025ab2 100644 --- a/src/components/contacts/ContactDropDownMenu.vue +++ b/src/components/contacts/ContactDropDownMenu.vue @@ -14,6 +14,14 @@
{{ contact.advName }}
+ + + + + + Reset Path + + @@ -46,6 +54,13 @@ export default { "contact-deleted", ], methods: { + async onResetPath(contact) { + + // reset path + await Connection.resetContactPath(contact.publicKey); + await Connection.loadContacts(); + + }, async onDeleteContact(contact) { // confirm user wants to remove this contact diff --git a/src/js/Connection.js b/src/js/Connection.js index c2ea657..10e7eac 100644 --- a/src/js/Connection.js +++ b/src/js/Connection.js @@ -65,6 +65,10 @@ class Connection { await GlobalState.connection.sendCommandSetDeviceTime(timestamp); } + static async resetContactPath(publicKey) { + await GlobalState.connection.sendCommandResetPath(publicKey); + } + static async removeContact(publicKey) { await GlobalState.connection.sendCommandRemoveContact(publicKey); }