mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-12-05 14:19:58 -05:00
add ability to double click an lxmf.delivery node in network visualiser to open the conversation
This commit is contained in:
parent
4ae83ca980
commit
580c907138
4 changed files with 84 additions and 1 deletions
|
|
@ -165,6 +165,47 @@ export default {
|
|||
},
|
||||
});
|
||||
|
||||
// handle double click on a node
|
||||
this.network.on("doubleClick", (params) => {
|
||||
|
||||
// get clicked node id
|
||||
const clickedNodeId = params.nodes[0];
|
||||
if(!clickedNodeId){
|
||||
return;
|
||||
}
|
||||
|
||||
// find node by id
|
||||
const node = this.network.body.nodes[clickedNodeId];
|
||||
if(!node){
|
||||
return;
|
||||
}
|
||||
|
||||
// handle double click on an announce node
|
||||
if(node.options.group === "announce"){
|
||||
|
||||
// get announce
|
||||
const announce = node.options._announce;
|
||||
if(!announce) {
|
||||
return;
|
||||
}
|
||||
|
||||
// handle double click on lxmf.delivery node
|
||||
if(announce.aspect === "lxmf.delivery"){
|
||||
|
||||
// go to messages page for this destination hash
|
||||
this.$router.push({
|
||||
name: "messages",
|
||||
params: {
|
||||
destinationHash: announce.destination_hash,
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// update network
|
||||
await this.update();
|
||||
|
||||
|
|
@ -358,6 +399,9 @@ export default {
|
|||
|
||||
}
|
||||
|
||||
// attach announce to this node
|
||||
node._announce = announce;
|
||||
|
||||
// add node
|
||||
nodes.push(node);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue