Files
radicle-explorer/src/views/nodes/NodeAddress.svelte
T
Sebastian Martinez 723d188e9e Fix copying wrong ids when switching cob listing state
We don't really need the `clipboard` prop.
By switching between stats in patches and issue listings the clipboard
props aren't been recomputed.

Wrote a test that should make sure this doesn't break in the future.
2024-11-27 11:00:17 +01:00

24 lines
616 B
Svelte

<script lang="ts">
import type { Node } from "@http-client";
import { truncateId } from "@app/lib/utils";
import Id from "@app/components/Id.svelte";
export let node: Node;
$: clipboard = node.config?.externalAddresses
? `${node.id}@${node.config.externalAddresses[0]}`
: node.id;
</script>
<div style:word-break="break-word">
<!--prettier-ignore-->
<Id ariaLabel="node-id" shorten={false} id={clipboard}>
{#if node.config?.externalAddresses.length}
{truncateId(node.id)}@<wbr />{node.config?.externalAddresses[0]}
{:else}
{truncateId(node.id)}
{/if}
</Id>
</div>