Commit eaab4a1
authored
[Website] Prevent creation of two temporary sites (#1817)
## Motivation for the change, related issues
#1731 introduced multiple Playground management. However, visiting a URL
containing a Blueprint sometimes led to a creation of multiple temporary
sites due to a React effect running twice. This PR prevents that error
by delaying the new site creation until the effect settles down. In
particular, we're waiting for the site list to either get loaded or
error out.
## Testing Instructions (or ideally a Blueprint)
Go to
http://localhost:5400/website-server/?plugin=classic-editor&blueprint-url=https%3A%2F%2Fwordpress.org%2Fplugins%2Fwp-json%2Fplugins%2Fv1%2Fplugin%2Fclassic-editor%2Fblueprint.json%3Frev%3D3158978%26lang%3Den_US
and confirm you only got a single temporary site1 parent a415c79 commit eaab4a1
File tree
1 file changed
+8
-0
lines changed- packages/playground/website/src/components/ensure-playground-site
1 file changed
+8
-0
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| |||
0 commit comments