Skip to content

Commit 92b6748

Browse files
authored
fix(web): format IPv6 peer addresses and copy IP without port (#1417)
1 parent 5658421 commit 92b6748

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

web/src/components/torrents/details/PeersTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const PeersTable = memo(function PeersTable({
8080
id: "address",
8181
header: "IP:Port",
8282
cell: (info) => {
83-
const displayIp = incognitoMode ? "192.168.x.x" : info.row.original.ip
83+
const displayIp = incognitoMode ? "192.168.x.x" : ( info.row.original.ip.match(/:/) ? `[${info.row.original.ip}]` : info.row.original.ip )
8484
const displayPort = incognitoMode ? "xxxxx" : info.row.original.port
8585
return (
8686
<span className="font-mono text-xs">
@@ -202,7 +202,7 @@ export const PeersTable = memo(function PeersTable({
202202

203203
const handleCopyIp = (peer: SortedPeer) => {
204204
if (incognitoMode) return
205-
copyTextToClipboard(`${peer.ip}:${peer.port}`)
205+
copyTextToClipboard(`${peer.ip}`)
206206
toast.success("IP address copied to clipboard")
207207
}
208208

0 commit comments

Comments
 (0)