fix: hide SOLARGOD portal link off-localhost — it targets a dev server
The deep-link keeps working in local dev; on partly.party it would be a dead localhost button until SOLARGOD has a public home. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
f55d3202e0
commit
a435997a3d
5
js/ui.js
5
js/ui.js
@ -121,6 +121,11 @@ export function setLiveChip(isLive) {
|
|||||||
export function wireSolargodLink(getMs) {
|
export function wireSolargodLink(getMs) {
|
||||||
const a = document.getElementById('solargod-link');
|
const a = document.getElementById('solargod-link');
|
||||||
if (!a) return;
|
if (!a) return;
|
||||||
|
// SOLARGOD is a localhost dev server for now — showing that link on the live
|
||||||
|
// site would be a dead button. Hide it unless GODSIGH itself is on localhost;
|
||||||
|
// when SOLARGOD gets a public home, point this at it and drop the guard.
|
||||||
|
const local = /^(127\.0\.0\.1|localhost)$/.test(location.hostname);
|
||||||
|
if (!local) { a.style.display = 'none'; return; }
|
||||||
const sync = () => { a.href = `http://127.0.0.1:8147/#t=@${getMs()}`; };
|
const sync = () => { a.href = `http://127.0.0.1:8147/#t=@${getMs()}`; };
|
||||||
a.addEventListener('pointerdown', sync);
|
a.addEventListener('pointerdown', sync);
|
||||||
a.addEventListener('click', sync);
|
a.addEventListener('click', sync);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user