mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-09-01 21:28:19 +00:00
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:
+5
-6
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user