diff --git a/app/LoadingApp/components/ConnectIndexer.tsx b/app/LoadingApp/components/ConnectIndexer.tsx index c3882f60c..3c880b4af 100644 --- a/app/LoadingApp/components/ConnectIndexer.tsx +++ b/app/LoadingApp/components/ConnectIndexer.tsx @@ -317,7 +317,7 @@ const ConnectIndexer: React.FunctionComponent = ({ }} > = ({ fromSettings, goConnectIndexer, goAvailableServers, + setIndexerServer, }) => { const context = useContext(ContextAppLoading); const { @@ -54,6 +56,15 @@ const SelectNetwork: React.FunctionComponent = ({ const screenName = ScreenEnum.Servers; const [kbOpen, setKbOpen] = useState(false); + const [indexerServerUriLocal] = useState( + indexerServerContext.uri ? indexerServerContext.uri : serverUris()[0].uri, + ); + + const [, setIndexerServerChainNameLocal] = useState( + indexerServerContext.uri + ? indexerServerContext.chainName + : serverUris()[0].chainName, + ); const insets = useSafeAreaInsets(); @@ -231,6 +242,11 @@ const SelectNetwork: React.FunctionComponent = ({ style={{ width: '100%' }} disabled={actionButtonsDisabled} onPress={() => { + setIndexerServerChainNameLocal(ChainNameEnum.testChainName); + setIndexerServer( + indexerServerUriLocal, + ChainNameEnum.testChainName, + ); goConnectIndexer(); }} > @@ -323,6 +339,13 @@ const SelectNetwork: React.FunctionComponent = ({ hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }} disabled={actionButtonsDisabled} onPress={() => { + setIndexerServerChainNameLocal( + ChainNameEnum.regtestChainName, + ); + setIndexerServer( + indexerServerUriLocal, + ChainNameEnum.regtestChainName, + ); goConnectIndexer(); }} > diff --git a/app/LoadingApp/components/ServerListScreen.tsx b/app/LoadingApp/components/ServerListScreen.tsx index 2495a2988..7f7128d5d 100644 --- a/app/LoadingApp/components/ServerListScreen.tsx +++ b/app/LoadingApp/components/ServerListScreen.tsx @@ -140,7 +140,7 @@ export const ServerListScreen: React.FC = ({ - + { + if (navigation.canGoBack()) { + navigation.goBack(); + } + }} + ExtraComponent={} + /> + + + + {/* Content */} + - { - if (navigation.canGoBack()) { - navigation.goBack(); - } - }} - ExtraComponent={} - /> - - + > + Staking positions + - {/* Content */} - {/* Staked TX list */} - - Staking positions - + item.txid} + renderItem={renderStakedTxItem} + ItemSeparatorComponent={renderSeparator} + ListEmptyComponent={ + + You don't have any staking positions that match the + currently selected filters. + + } + /> + + + {/* Modal */} + { + if (modalState === 'success') { + setModalState('idle'); + } + }} + > + - item.txid} - renderItem={renderStakedTxItem} - ItemSeparatorComponent={renderSeparator} - ListEmptyComponent={ + {modalState === 'sending' && ( + <> + - You don't have any staking positions that match the - currently selected filters. + Sending unstaking transaction… - } - /> - - + + )} - {/* Modal */} - { - if (modalState === 'success') { - setModalState('idle'); - } - }} - > - - - {modalState === 'sending' && ( - <> - - - Sending unstaking transaction… - - - )} + {modalState === 'success' && ( + <> + + + Unstaking request transaction sent! + - {modalState === 'success' && ( - <> - + - - Unstaking request transaction sent! - - - - - - - )} - + + + )} - - - + + + ); }