Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

bug: the current market is missing from the market switcher when it is a legacy market

未关闭 适合新手
#3,128 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@shivam-V8 已经在做这个了。

开始于 2026年10月11日。

  • #3126 来自 @shivam-V8 —— 未关闭
  • #3129 来自 @shivam-V8 —— 未关闭
  • #3130 来自 @shivam-V8 —— 未关闭
  • #3132 来自 @shivam-V8 —— 未关闭
  • #3136 来自 @shivam-V8 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
86/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
react, typescript
领域
frontend

调研方向

门控位于 src/components/MarketSwitcher.tsx:第 297 行的 showLegacy useState 初始值为 false,legacy 分组只有在其开启时才会渲染(第 707-712 行)。请阅读 getMarketCategory(约第 162 行)和 isSelected 检查(约第 383 行)。完成标准是:在全新加载页面时,无需切换 legacy 开关,像 Gnosis 这样的 legacy 市场就已列出并被标记为已选中。

由索引模型根据 Issue 内容生成。

描述

Describe the bug

When the currently selected market is a legacy market (Gnosis, Sonic, Scroll, Metis, ZKsync, Soneium, EtherFi), opening the market switcher does not list it. The active market is missing from the dropdown entirely and nothing is marked as selected, so the switcher gives no indication of which market you are actually on.

showLegacy is local component state initialised to false (src/components/MarketSwitcher.tsx:297) and is never persisted, so it resets on every mount, regardless of the market being viewed:

// src/components/MarketSwitcher.tsx:297
const [showLegacy, setShowLegacy] = useState(false);

The legacy group is only rendered when that flag is on (MarketSwitcher.tsx:707-712), and isSelected (MarketSwitcher.tsx:383) can only highlight an item that is rendered. The header trigger still shows the correct market name, so the switcher contradicts itself: the header says "Gnosis", the list says Gnosis does not exist.

This became user-visible for Gnosis and Sonic when #3111 moved them into the legacy category (MarketSwitcher.tsx:158-159); the showLegacy switch itself arrived with the v3 uplift (#3075).

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://app.aave.com/?marketName=proto_gnosis_v3 (Gnosis V3), or select Gnosis after enabling "Show legacy markets"
  2. Reload the page
  3. Open the market switcher in the header
  4. See that Gnosis — the market currently being viewed — is not listed anywhere and no market appears selected, until "Show legacy markets" is toggled on again

Expected behavior

The market you are currently viewing should always be visible in the switcher and marked as selected. Initialising showLegacy from the current market's category would do it, e.g.

const [showLegacy, setShowLegacy] = useState(() => getMarketCategory(currentMarket) === 'legacy');

reusing the existing getMarketCategory helper (MarketSwitcher.tsx:162).

Screenshots

n/a — reproducible from the source as described above.

Desktop (please complete the following information):

  • OS: any
  • Browser: any (not browser-specific)
  • Version: main @ 32cc548b9

Smartphone (please complete the following information):

  • Device: any
  • OS: any
  • Browser: any (the same code path renders the mobile sheet)
  • Version: main @ 32cc548b9

Additional context

This affects precisely the users who still hold positions in a legacy market: the market they are using disappears from the switcher on every page load. Combined with the search behaviour, finding the market again is non-obvious. Happy to open a PR covering both.

Related: #3127 (same root cause — the showLegacy gate — seen from the search side).

主要语言
TypeScript
星标
537
派生
495
平均合并
1 天 18 小时
30 天内合并 PR
15

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aave/interface 的其他 Issue

查看 aave/interface 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。