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)}
|
onChange={(e) => setCustomNodeText(e.target.value)}
|
||||||
/>
|
/>
|
||||||
<Link
|
<Link
|
||||||
aria-disabled={!customNodeText}
|
aria-disabled={
|
||||||
|
!customNodeText ||
|
||||||
|
getIsNodeLoading(state[CUSTOM_NODE_KEY])
|
||||||
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setNetworkError(null);
|
setNetworkError(null);
|
||||||
updateNodeUrl(CUSTOM_NODE_KEY, customNodeText);
|
updateNodeUrl(CUSTOM_NODE_KEY, customNodeText);
|
||||||
|
@ -2,17 +2,13 @@ import { t } from '@vegaprotocol/react-helpers';
|
|||||||
import { CUSTOM_NODE_KEY, ErrorType } from '../types';
|
import { CUSTOM_NODE_KEY, ErrorType } from '../types';
|
||||||
import type { Networks, NodeData } from '../types';
|
import type { Networks, NodeData } from '../types';
|
||||||
|
|
||||||
export const getIsNodeLoading = ({
|
export const getIsNodeLoading = (node?: NodeData): boolean => {
|
||||||
chain,
|
if (!node) return false;
|
||||||
responseTime,
|
|
||||||
block,
|
|
||||||
ssl,
|
|
||||||
}: NodeData) => {
|
|
||||||
return (
|
return (
|
||||||
chain.isLoading ||
|
node.chain.isLoading ||
|
||||||
responseTime.isLoading ||
|
node.responseTime.isLoading ||
|
||||||
block.isLoading ||
|
node.block.isLoading ||
|
||||||
ssl.isLoading
|
node.ssl.isLoading
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user