From a5a82c6f04eb248819b5e5b064384599930408b8 Mon Sep 17 00:00:00 2001 From: GinMu Date: Thu, 16 Jan 2025 09:36:34 +0800 Subject: [PATCH] fixed: Avoid returning a new reference inside 'selectAvailableNetworkClientIds' selector --- packages/network-controller/src/NetworkController.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/network-controller/src/NetworkController.ts b/packages/network-controller/src/NetworkController.ts index 0e20648bde8..334b8acadca 100644 --- a/packages/network-controller/src/NetworkController.ts +++ b/packages/network-controller/src/NetworkController.ts @@ -594,11 +594,10 @@ export function getDefaultNetworkControllerState(): NetworkState { * @param state - NetworkController state * @returns A list of all available network configurations */ -export function getNetworkConfigurations( - state: NetworkState, -): NetworkConfiguration[] { - return Object.values(state.networkConfigurationsByChainId); -} +export const getNetworkConfigurations = createSelector( + (state: NetworkState): Record => state.networkConfigurationsByChainId, + (networkConfigurationsByChainId): NetworkConfiguration[] => Object.values(networkConfigurationsByChainId), +) /** * Get a list of all available client IDs from a list of