Skip to content

Commit

Permalink
fixed bug on frontend in mermaid tx chart with BroadcastEmitted
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisbatyk committed Oct 11, 2024
1 parent 74198ca commit a9a72d6
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions network-monitor/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,8 @@ export const get_peers_description_to_render = (
let peer_target = peer.target;

if (typeof peer_target == "string") {
peer_target = peer_target.split(" (@")[0].slice(-8);
} else {
peer_target = peer_target
.map((t: string) => t.split(" (@")[0].slice(-8))
.join("; ");
//peer_target = peer_target.split(" (@")[0].slice(-8);
peer_target = [peer_target];
}

let sliced_id = peer_id.slice(-8);
Expand All @@ -299,13 +296,17 @@ export const get_peers_description_to_render = (
? "style " + sliced_id + " stroke:#1B2A41,stroke-width:3px"
: null;

let peer_connection = `${sliced_id} ${connection_type}|${change_type}| ${peer_target}`;
for (let one_peer of peer_target) {
one_peer = one_peer.split(" (@")[0].slice(-8);

if (node_styling) {
peer_connection += "\n" + node_styling;
}
let peer_connection = `${sliced_id} ${connection_type}|${change_type}| ${one_peer}`;

peer_description += peer_connection + "\n";
if (node_styling) {
peer_connection += "\n" + node_styling;
}

peer_description += peer_connection + "\n";
}
}

return peer_description;
Expand Down

0 comments on commit a9a72d6

Please sign in to comment.