From 6c137fc0fd142fc4bf3099c58f6d4444d7a01409 Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 26 Mar 2021 02:59:36 -0400 Subject: [PATCH] improve loading for livestream setup --- ui/page/livestreamSetup/view.jsx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/page/livestreamSetup/view.jsx b/ui/page/livestreamSetup/view.jsx index 8480f7aec..27956cefe 100644 --- a/ui/page/livestreamSetup/view.jsx +++ b/ui/page/livestreamSetup/view.jsx @@ -28,6 +28,7 @@ export default function LivestreamSetupPage(props: Props) { const [sigData, setSigData] = React.useState({ signature: undefined, signing_ts: undefined }); const [showHelpTest, setShowHelpTest] = usePersistedState('livestream-help-seen', true); + const [spin, setSpin] = React.useState(true); const hasChannels = channels && channels.length > 0; const activeChannelClaimStr = JSON.stringify(activeChannelClaim); @@ -118,11 +119,13 @@ export default function LivestreamSetupPage(props: Props) { } else { setLivestreamClaims([]); } + setSpin(false); }) .catch(() => { setLivestreamClaims([]); + setSpin(false); }); - }, [activeChannelClaimStr, pendingLength, setShowHelpTest]); + }, [activeChannelClaimStr, pendingLength, setSpin]); return ( @@ -143,14 +146,21 @@ export default function LivestreamSetupPage(props: Props) { } /> )} + {!fetchingChannels && ( +
+ +
+ )} + {spin && !fetchingChannels && ( +
+ +
+ )}
- {!fetchingChannels && activeChannelClaim && ( + {!spin && !fetchingChannels && activeChannelClaim && ( <> -
- -
{showHelpTest && ( setShowHelpTest(false)} />}