diff --git a/main.js b/main.js index 77b91a9..1ac035d 100644 --- a/main.js +++ b/main.js @@ -1006,12 +1006,31 @@ ipcMain.handle("collision-switch", async (_e, arg) => { const choice = (raw === "bcdn" || raw === "bcnr") ? "bcnr" : (raw === "icann") ? "icann" : (t.prov.kind === "ok" ? "icann" : "bcnr"); // flip the current one - // Transient per-tab override consumed once by loadBns — no soft-mode re-prompt - // for this specific chip-triggered switch. - t.collisionOverride = choice; // Optional persistent memory ("Always use…" from the popover switcher). rememberCollision(host, tld, choice, arg?.remember || "no"); - return navigateTab(t.id, host + (t.prov.path || "/")); + const registry = registryOf(tld); + // DIRECT navigation — bypass navigateTab/loadBns entirely so nothing in the + // collision-decision path can trigger a re-prompt on an explicit user switch. + // The user clicked the switcher; they've made their choice. Just load it. + setLoading(t, true); + t.internalNav = true; + try { + if (choice === "icann") { + t.url = "https://" + host + "/"; + await t.view.webContents.loadURL(t.url); + t.prov = { host, kind: "web", note: "switched to ICANN", tld, registry }; + } else { + t.url = host + "/"; + await t.view.webContents.loadURL(`bns://${host}/`); + const rec = entries.get(host); + const r = rec?.entry?.records || {}; + const src = r.h ? "on-chain (chain)" : r.s3 ? "Sia network" : r.ip ? "direct server" : r.u ? "redirect" : "record"; + t.prov = { host, kind: "ok", source: src, category: rec?.entry?.category, records: Object.keys(r), tld, registry }; + } + } catch (e) { console.warn("collision-switch load failed:", e?.message); } + finally { t.internalNav = false; setLoading(t, false); } + if (t.id === activeId) pushNav(t.prov); + emitTabs(); }); ipcMain.handle("collision-state", () => ({ policy: settings.collisionPolicy,