Rewild Your Web
18
fork

Configure Feed

Select the types of activity you want to include in your feed.

p2p: display peer name instead of peer id

Signed-off-by: webbeef <me@webbeef.org>

webbeef c286c6fe 0bc8c31b

+14 -2
+14 -2
ui/system/index.js
··· 978 978 }; 979 979 }; 980 980 981 - function showOpenViewDialog(peerId, url) { 981 + async function showOpenViewDialog(peerId, url) { 982 + // Look up the peer's display name. 983 + let peerName = peerId; 984 + try { 985 + const peers = await navigator.embedder.pairing.peers(); 986 + const peer = peers.find((p) => p.id === peerId); 987 + if (peer?.displayName) { 988 + peerName = peer.displayName; 989 + } 990 + } catch { 991 + // Fall back to raw ID. 992 + } 993 + 982 994 // Show a confirmation dialog. 983 995 // TODO: don't inline styles. 984 996 const dialog = document.createElement("dialog"); 985 997 dialog.id = "p2p-open-dialog"; 986 998 dialog.innerHTML = ` 987 - <h2>Open page from peer?</h2> 999 + <h2>Open page from ${peerName}?</h2> 988 1000 <p style="word-break: break-all; opacity:0.8; font-size:0.9em">${url}</p> 989 1001 <div style="display:flex; gap:0.5em; justify-content:flex-end; margin-top: 1em"> 990 1002 <button class="btn-cancel">Decline</button>