Merge branch 'dev'
CI/CD / deploy (push) Waiting to run Details

This commit is contained in:
Jeff Emmett 2026-04-02 16:05:25 -07:00
commit a73746bec3
2 changed files with 13 additions and 1 deletions

View File

@ -242,9 +242,10 @@ export function renderMainLanding(modules: ModuleInfo[]): string {
import '/shell.js';
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
// Logged-in users: hide header demo btn, swap hero CTA to "Go to My Space"
// Logged-in users: hide header demo btn, swap hero CTA + space switcher
try {
var raw = localStorage.getItem('encryptid_session');
var sw = document.querySelector('rstack-space-switcher');
if (raw) {
var session = JSON.parse(raw);
var hdrBtn = document.querySelector('.rstack-header__demo-btn');
@ -256,7 +257,10 @@ export function renderMainLanding(modules: ModuleInfo[]): string {
primary.textContent = 'Go to My Space';
primary.href = 'https://' + username + '.rspace.online/rspace';
}
if (sw) { sw.setAttribute('current', username); sw.setAttribute('name', username + "'s Space"); }
}
} else {
if (sw) { sw.setAttribute('current', 'demo'); sw.setAttribute('name', 'demo'); }
}
} catch(e) {}
</script>

View File

@ -2262,6 +2262,7 @@ export function renderModuleLanding(opts: ModuleLandingOptions): string {
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
try {
var raw = localStorage.getItem('encryptid_session');
var sw = document.querySelector('rstack-space-switcher');
if (raw) {
var session = JSON.parse(raw);
if (session?.claims?.username) {
@ -2271,7 +2272,10 @@ export function renderModuleLanding(opts: ModuleLandingOptions): string {
primary.textContent = 'Go to My Space';
primary.href = 'https://' + username + '.rspace.online/${escapeAttr(mod.id)}';
}
if (sw) { sw.setAttribute('current', username); sw.setAttribute('name', username + "'s Space"); }
}
} else {
if (sw) { sw.setAttribute('current', 'demo'); sw.setAttribute('name', 'demo'); }
}
} catch(e) {}
</script>
@ -2597,6 +2601,7 @@ export function renderSubPageInfo(opts: SubPageInfoOptions): string {
document.querySelector('rstack-app-switcher')?.setModules(${moduleListJSON});
try {
var raw = localStorage.getItem('encryptid_session');
var sw = document.querySelector('rstack-space-switcher');
if (raw) {
var session = JSON.parse(raw);
if (session?.claims?.username) {
@ -2606,7 +2611,10 @@ export function renderSubPageInfo(opts: SubPageInfoOptions): string {
primary.textContent = 'Open in My Space';
primary.href = 'https://' + username + '.rspace.online/${escapeAttr(mod.id)}/${escapeAttr(subPage.path)}';
}
if (sw) { sw.setAttribute('current', username); sw.setAttribute('name', username + "'s Space"); }
}
} else {
if (sw) { sw.setAttribute('current', 'demo'); sw.setAttribute('name', 'demo'); }
}
} catch(e) {}
</script>