completionId: cgen-5a4da9cda4314ebebf1aef196d28f913

cgen-5a4da9cda4314ebebf1aef196d28f913
This commit is contained in:
Builder.io 2025-11-16 10:17:33 +00:00
parent cbca474bdf
commit 3710b02a8e

View file

@ -106,6 +106,16 @@ const SubdomainPassport = () => {
setLoading(true);
setError(null);
// Check if server pre-fetched the data (for SSR)
const preloadedData = (window as any).__PASSPORT_DATA__;
if (preloadedData) {
console.log("[SubdomainPassport] Using pre-fetched server data");
setData(preloadedData);
setLoading(false);
return;
}
// Fallback to API call if no preloaded data
const apiBase = getApiBase();
if (!apiBase) {
setError("Cannot determine API base");