From f844f147b0f4158ff25ce074d19c0a9939548cf1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 21 Oct 2023 13:00:14 -0500 Subject: [PATCH] SoapboxMount: fix Suspense boundary for UI Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1589 --- src/init/soapbox-mount.tsx | 39 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/src/init/soapbox-mount.tsx b/src/init/soapbox-mount.tsx index ed7f70c47..db210c8fa 100644 --- a/src/init/soapbox-mount.tsx +++ b/src/init/soapbox-mount.tsx @@ -41,39 +41,16 @@ const SoapboxMount = () => { return !(location.state?.soapboxModalKey && location.state?.soapboxModalKey !== prevRouterProps?.location?.state?.soapboxModalKey); }; - /** Render the onboarding flow. */ - const renderOnboarding = () => ( - }> - - - ); - - /** Render the auth layout or UI. */ - const renderSwitch = () => ( - - {(!me && redirectRootNoLogin) && ( - - )} - - - - ); - - /** Render the onboarding flow or UI. */ - const renderBody = () => { - if (showOnboarding) { - return renderOnboarding(); - } else { - return renderSwitch(); - } - }; - return ( + {(!me && redirectRootNoLogin) && ( + + )} + ( @@ -82,10 +59,16 @@ const SoapboxMount = () => { )} /> + - {renderBody()} + }> + {showOnboarding + ? + : + } +