From 64bd603301b3067b6a69a29f66a28dee7ffa38f5 Mon Sep 17 00:00:00 2001 From: MananTank Date: Tue, 15 Apr 2025 22:16:26 +0000 Subject: [PATCH] Nebula: Do not override chains set from search params (#6738) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR refines the logic for updating `updatedContextFilters.chainIds` by ensuring that it only attempts to retrieve last used chains from storage when `chainIds` is empty. It also maintains error handling for local storage access. ### Detailed summary - Moved the check for `updatedContextFilters.chainIds` length to before retrieving last used chains. - Retained the logic to fetch last used chain IDs from storage if `chainIds` is empty. - Preserved error handling for local storage access. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../(app)/components/ChatPageContent.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx index e34db3c2e40..25b6bee5919 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx @@ -132,15 +132,17 @@ export function ChatPageContent(props: { updatedContextFilters.walletAddress = address; } - // if we have last used chains in storage, continue using them - try { - const lastUsedChainIds = getLastUsedChainIds(); - if (lastUsedChainIds) { - updatedContextFilters.chainIds = lastUsedChainIds; - return updatedContextFilters; + if (updatedContextFilters.chainIds?.length === 0) { + // if we have last used chains in storage, continue using them + try { + const lastUsedChainIds = getLastUsedChainIds(); + if (lastUsedChainIds) { + updatedContextFilters.chainIds = lastUsedChainIds; + return updatedContextFilters; + } + } catch { + // ignore local storage errors } - } catch { - // ignore local storage errors } return updatedContextFilters;