Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#3,128 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@shivam-V8 ci sta già lavorando.

Dal 11/10/2026.

  • #3130 di @shivam-V8 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
86/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Il gate si trova in src/components/MarketSwitcher.tsx: lo useState showLegacy alla riga 297 parte da false, e il gruppo legacy viene renderizzato solo quando è attivo (righe 707-712). Leggi getMarketCategory (intorno alla riga 162) e il controllo isSelected (intorno alla riga 383). È completato quando un mercato legacy come Gnosis è elencato e risulta selezionato al primo caricamento della pagina, senza attivare l'interruttore legacy.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
TypeScript
Stelle
537
Fork
495
Merge medio
1g 13h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aave/interface

Tutte le issue di aave/interface

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.