completionId: cgen-5a4da9cda4314ebebf1aef196d28f913
cgen-5a4da9cda4314ebebf1aef196d28f913
This commit is contained in:
parent
cbca474bdf
commit
3710b02a8e
1 changed files with 10 additions and 0 deletions
|
|
@ -106,6 +106,16 @@ const SubdomainPassport = () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
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();
|
const apiBase = getApiBase();
|
||||||
if (!apiBase) {
|
if (!apiBase) {
|
||||||
setError("Cannot determine API base");
|
setError("Cannot determine API base");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue