diff --git a/packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx b/packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx index 2646bb8585..3a29b54c1d 100644 --- a/packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx +++ b/packages/playground/website/src/components/ensure-playground-site/ensure-playground-site-is-selected.tsx @@ -75,6 +75,14 @@ export function EnsurePlaygroundSiteIsSelected({ return; } + // Don't create a new temporary site until the site listing settles. + // Otherwise, the status change from "loading" to "loaded" would + // re-run this entire effect, potentially leading to multiple + // sites being created since we couldn't look for duplicates yet. + if (!['loaded', 'error'].includes(siteListingStatus)) { + return; + } + // If the site slug is missing, create a new temporary site. // Lean on the Query API parameters and the Blueprint API to // create the new site.