diff --git a/src/components/pages/NodePage.vue b/src/components/pages/NodePage.vue
index 9b76423..4ece17d 100644
--- a/src/components/pages/NodePage.vue
+++ b/src/components/pages/NodePage.vue
@@ -7,11 +7,16 @@
-
+
+
+
+
@@ -126,6 +131,22 @@ export default {
getRoleName: (roleId) => NodeUtils.getRoleName(roleId),
getHardwareName: (roleId) => NodeUtils.getHardwareName(roleId),
latLongIntegerToLatLong: (latLongInteger) => NodeUtils.latLongIntegerToLatLong(latLongInteger),
+ async onDeleteNode(node) {
+
+ // confirm user wants to remove this node
+ if(!confirm("Are you sure you want to forget this node?")){
+ return;
+ }
+
+ // go back to main page
+ this.$router.push({
+ name: "main",
+ });
+
+ // remove node
+ await NodeAPI.removeNodeByNum(node.num);
+
+ },
onRequestNodeInfo(node) {
NodeAPI.requestNodeInfo(node.num);
},
diff --git a/src/js/NodeAPI.js b/src/js/NodeAPI.js
index 99e5711..bd2530e 100644
--- a/src/js/NodeAPI.js
+++ b/src/js/NodeAPI.js
@@ -36,6 +36,16 @@ class NodeAPI {
}
+ /**
+ * Removes the node from global state, and also tells the meshtastic device to remove the node.
+ * @param nodeId the node id to remove
+ * @returns {Promise<*>}
+ */
+ static async removeNodeByNum(nodeId) {
+ delete GlobalState.nodesById[nodeId];
+ return await GlobalState.connection.removeNodeByNum(nodeId);
+ }
+
}
export default NodeAPI;