diff --git a/frontend/js/brand-prime.js b/frontend/js/brand-prime.js index 309ed93..6f3ecfa 100644 --- a/frontend/js/brand-prime.js +++ b/frontend/js/brand-prime.js @@ -16,6 +16,16 @@ } catch (e) { /* malformed token -> treat as no workspace */ } var wl = JSON.parse(localStorage.getItem('rd_branding_' + ws) || 'null'); + if (!wl) { + // #76: no per-workspace cache yet (e.g. a never-visited org). Fall back to + // the server-injected instance / custom-domain branding so the page paints + // the configured brand instead of flashing the ScreenTinker default; + // branding.js then fetches and caches the workspace-specific brand. + try { + var ssr = document.querySelector('meta[name="ssr-brand"]'); + if (ssr && ssr.content) wl = JSON.parse(ssr.content); + } catch (e) { /* ignore */ } + } if (!wl) return; var root = document.documentElement; diff --git a/server/server.js b/server/server.js index c43b94c..7379e35 100644 --- a/server/server.js +++ b/server/server.js @@ -154,9 +154,25 @@ app.get('/', (req, res) => { res.sendFile(path.join(config.frontendDir, 'landing.html')); }); -// Dashboard app +// Dashboard app. Inject the resolved instance / custom-domain branding into the +// shell as a (#76) so brand-prime can apply it before first paint when the +// per-workspace brand is not cached yet - no ScreenTinker flash on a never-visited +// org. CSP blocks inline