fix: make check link unclickable while loading (#928)
* fix: make check link unclickable while loading * fix: format
This commit is contained in:
parent
7b4e618689
commit
b1ded718a1
@ -169,7 +169,10 @@ export const NodeSwitcher = ({
|
||||
onChange={(e) => setCustomNodeText(e.target.value)}
|
||||
/>
|
||||
<Link
|
||||
aria-disabled={!customNodeText}
|
||||
aria-disabled={
|
||||
!customNodeText ||
|
||||
getIsNodeLoading(state[CUSTOM_NODE_KEY])
|
||||
}
|
||||
onClick={() => {
|
||||
setNetworkError(null);
|
||||
updateNodeUrl(CUSTOM_NODE_KEY, customNodeText);
|
||||
|
@ -2,17 +2,13 @@ import { t } from '@vegaprotocol/react-helpers';
|
||||
import { CUSTOM_NODE_KEY, ErrorType } from '../types';
|
||||
import type { Networks, NodeData } from '../types';
|
||||
|
||||
export const getIsNodeLoading = ({
|
||||
chain,
|
||||
responseTime,
|
||||
block,
|
||||
ssl,
|
||||
}: NodeData) => {
|
||||
export const getIsNodeLoading = (node?: NodeData): boolean => {
|
||||
if (!node) return false;
|
||||
return (
|
||||
chain.isLoading ||
|
||||
responseTime.isLoading ||
|
||||
block.isLoading ||
|
||||
ssl.isLoading
|
||||
node.chain.isLoading ||
|
||||
node.responseTime.isLoading ||
|
||||
node.block.isLoading ||
|
||||
node.ssl.isLoading
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user