Page MenuHomePhabricator

D7927.diff
No OneTemporary

D7927.diff

diff --git a/native/account/registration/connect-ethereum.react.js b/native/account/registration/connect-ethereum.react.js
--- a/native/account/registration/connect-ethereum.react.js
+++ b/native/account/registration/connect-ethereum.react.js
@@ -7,6 +7,7 @@
exactSearchUser,
exactSearchUserActionTypes,
} from 'lib/actions/user-actions.js';
+import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
import type { SIWEResult } from 'lib/types/siwe-types.js';
import {
useServerCall,
@@ -24,10 +25,15 @@
ExistingEthereumAccountRouteName,
UsernameSelectionRouteName,
} from '../../navigation/route-names.js';
+import { useSelector } from '../../redux/redux-utils.js';
import { useStyles } from '../../themes/colors.js';
import EthereumLogoDark from '../../vectors/ethereum-logo-dark.react.js';
import SIWEPanel from '../siwe-panel.react.js';
+const exactSearchUserLoadingStatusSelector = createLoadingStatusSelector(
+ exactSearchUserActionTypes,
+);
+
export type ConnectEthereumParams = {
+userSelections: {
+coolOrNerdMode: CoolOrNerdMode,
@@ -151,6 +157,14 @@
);
}
+ const exactSearchUserCallLoading = useSelector(
+ state => exactSearchUserLoadingStatusSelector(state) === 'loading',
+ );
+ const connectButtonVariant =
+ exactSearchUserCallLoading || panelState === 'opening'
+ ? 'loading'
+ : 'enabled';
+
return (
<>
<RegistrationContainer>
@@ -167,7 +181,7 @@
<RegistrationButton
onPress={openPanel}
label="Connect Ethereum wallet"
- variant={panelState === 'opening' ? 'loading' : 'enabled'}
+ variant={connectButtonVariant}
/>
<RegistrationButton
onPress={onSkip}

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 12:17 AM (21 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609411
Default Alt Text
D7927.diff (1 KB)

Event Timeline