Skip to content

Commit 64bd603

Browse files
committed
Nebula: Do not override chains set from search params (#6738)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## 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}` <!-- end pr-codex -->
1 parent 60a5b7c commit 64bd603

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,17 @@ export function ChatPageContent(props: {
132132
updatedContextFilters.walletAddress = address;
133133
}
134134

135-
// if we have last used chains in storage, continue using them
136-
try {
137-
const lastUsedChainIds = getLastUsedChainIds();
138-
if (lastUsedChainIds) {
139-
updatedContextFilters.chainIds = lastUsedChainIds;
140-
return updatedContextFilters;
135+
if (updatedContextFilters.chainIds?.length === 0) {
136+
// if we have last used chains in storage, continue using them
137+
try {
138+
const lastUsedChainIds = getLastUsedChainIds();
139+
if (lastUsedChainIds) {
140+
updatedContextFilters.chainIds = lastUsedChainIds;
141+
return updatedContextFilters;
142+
}
143+
} catch {
144+
// ignore local storage errors
141145
}
142-
} catch {
143-
// ignore local storage errors
144146
}
145147

146148
return updatedContextFilters;

0 commit comments

Comments
 (0)