Pass server-disambiguated full pubkeys to map route view

Was fetching /api/resolve-hops (with geographic disambiguation) then
throwing away the result and still passing raw 1-byte prefixes. Now
passes full pubkeys so the map doesn't re-disambiguate differently.
This commit is contained in:
you
2026-03-19 08:15:39 +00:00
parent 36368bc0e9
commit a81fd21af9
+5 -6
View File
@@ -507,13 +507,12 @@
try {
const resp = await fetch('/api/resolve-hops?hops=' + encodeURIComponent(pathHops.join(',')));
const data = await resp.json();
// Build array of {hop, name, pubkey} with resolved full pubkeys
const resolvedHops = pathHops.map(h => {
const name = data.resolved[h];
// Find full pubkey from name if possible
return name || h;
// Pass full pubkeys (server-disambiguated) to map, falling back to short prefix
const resolvedKeys = pathHops.map(h => {
const r = data.resolved?.[h];
return r?.pubkey || h;
});
sessionStorage.setItem('map-route-hops', JSON.stringify(pathHops));
sessionStorage.setItem('map-route-hops', JSON.stringify(resolvedKeys));
window.location.hash = '#/map?route=1';
} catch {
window.location.hash = '#/map';