From 74cf9781c3e4577da7848ed9d4b65b54a58cd4e8 Mon Sep 17 00:00:00 2001 From: gregs Date: Wed, 20 Dec 2023 07:50:28 +0800 Subject: [PATCH 1/2] Slow down URL validation when adding a network or RPC (#1241) --- src/entries/popup/pages/settings/customChain/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/entries/popup/pages/settings/customChain/index.tsx b/src/entries/popup/pages/settings/customChain/index.tsx index 9f84ea7ecc..6fa5256be1 100644 --- a/src/entries/popup/pages/settings/customChain/index.tsx +++ b/src/entries/popup/pages/settings/customChain/index.tsx @@ -1,5 +1,5 @@ import { isEqual } from 'lodash'; -import React, { useCallback, useEffect, useRef, useState } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; import { useLocation } from 'react-router'; import { Chain } from 'wagmi'; @@ -320,17 +320,17 @@ export function SettingsCustomChain() { symbol: true, explorerUrl: true, }); - const debuncedRpcUrl = useDebounce(customRPC.rpcUrl, 500); const inputRef = useRef(null); + const debouncedRpcUrl = useDebounce(customRPC.rpcUrl, 1000); const { data: chainMetadata, isFetching: chainMetadataIsFetching, isError: chainMetadataIsError, isFetched: chainMetadataIsFetched, } = useChainMetadata( - { rpcUrl: debuncedRpcUrl }, - { enabled: !!debuncedRpcUrl && isValidUrl(debuncedRpcUrl) }, + { rpcUrl: debouncedRpcUrl }, + { enabled: !!debouncedRpcUrl && isValidUrl(debouncedRpcUrl) }, ); const prevChainMetadata = usePrevious(chainMetadata); From a2dcf0b4a3a1f155f5df149fbc4056f2239a2c49 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:55:32 -0300 Subject: [PATCH 2/2] Turn on custom networks (#1220) --- src/core/state/currentSettings/featureFlags.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/state/currentSettings/featureFlags.ts b/src/core/state/currentSettings/featureFlags.ts index 403e65cbc4..36be5cd6be 100644 --- a/src/core/state/currentSettings/featureFlags.ts +++ b/src/core/state/currentSettings/featureFlags.ts @@ -21,7 +21,7 @@ export const featureFlagsStore = createStore( full_watching_wallets: false, hw_wallets_enabled: true, command_k_internal_shortcuts_enabled: false, - custom_rpc: false, + custom_rpc: true, }, setFeatureFlag: (key, value) => { const { featureFlags } = get();