mirror of
https://github.com/aljazceru/meshcore-web.git
synced 2025-12-17 16:24:18 +01:00
add button to reset path
This commit is contained in:
@@ -14,6 +14,14 @@
|
||||
<div class="text-sm text-gray-500 font-semibold">{{ contact.advName }}</div>
|
||||
</div>
|
||||
|
||||
<!-- reset path button -->
|
||||
<DropDownMenuItem @click="onResetPath(contact)">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
||||
</svg>
|
||||
<span>Reset Path</span>
|
||||
</DropDownMenuItem>
|
||||
|
||||
<!-- delete contact button -->
|
||||
<DropDownMenuItem @click="onDeleteContact(contact)">
|
||||
<svg class="size-5 text-red-500" viewBox="0 0 20 20" fill="currentColor">
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user