add ability to double click an lxmf.delivery node in network visualiser to open the conversation

This commit is contained in:
liamcottle 2025-01-21 23:19:55 +13:00
parent 4ae83ca980
commit 580c907138
4 changed files with 84 additions and 1 deletions

View file

@ -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);