From 9b35b2cbdc571126873bb8d2bc58e2d7860b230f Mon Sep 17 00:00:00 2001 From: Travis Vachon Date: Thu, 23 Mar 2023 17:57:14 -0700 Subject: [PATCH] fix: wait for register space before returning from space create onSubmit (#463) because we weren't `await`ing here the space creation UI would flash empty again, which was very confusing --- examples/react/w3console/src/components/SpaceCreator.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/react/w3console/src/components/SpaceCreator.tsx b/examples/react/w3console/src/components/SpaceCreator.tsx index 4944ed32..c31e1c3c 100644 --- a/examples/react/w3console/src/components/SpaceCreator.tsx +++ b/examples/react/w3console/src/components/SpaceCreator.tsx @@ -34,9 +34,7 @@ export function SpaceCreatorForm ({ setSubmitted(true) try { await createSpace(name) - // ignore this because the Space UI should handle helping the user recover - // from space registration failure - void registerSpace(account, {provider: import.meta.env.VITE_W3UP_PROVIDER}) + await registerSpace(account, {provider: import.meta.env.VITE_W3UP_PROVIDER}) } catch (error) { /* eslint-disable no-console */ console.error(error)