diff --git a/pages/_app.tsx b/pages/_app.tsx index 9587541..a6a78ca 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -29,7 +29,7 @@ function App({ Component, pageProps }) { const isSupportCurrentNetwork = SUPPORT_NETWORKS.includes(chainId) const [backendVersion, setBackendVersion] = useState("err") - const [, actions] = useAsync(async() => { + const [autoLoginState, actions] = useAsync(async() => { if (!sigInLocal || !accountInLocal) return const cachedProvider = await createProvider(undefined, (id) => dispatch({ type: "SET_CHAIN_ID", chainId: id })) if (!cachedProvider) return @@ -117,6 +117,7 @@ function App({ Component, pageProps }) { const renderActionButton = () => { + if (!['success', 'error'].includes(autoLoginState.status)) return null if (!sigInLocal || !accountInLocal) { return ( - )} - - - - {({ active }) => ( - - )} - - - - - - + { + sigInLocal && account && isSupportCurrentNetwork && +
+ +
+ + +
+ + +
+ + {({ active }) => ( + + )} + + + + {({ active }) => ( + + )} + +
+
+
+
+
+ }