fix: AddToken screen is unreachable — ReferenceError: showView is not defined #150
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
src/popup/views/addToken.js:1imports:but
src/popup/views/addToken.js:24callsshowView("add-token").showViewis not in scope and there is no global, so
show()throws aReferenceErrorevery single time.
Effect: clicking "+ Token" on AddressDetail does nothing visible, and it
corrupts the navigation stack —
pushCurrentView()insrc/popup/index.js:76-79has already pushed"address"before the throw, sothe user's subsequent "Back" behaviour is wrong.
This makes the AddToken screen documented at
README.md:489-501and the"Adding ERC-20 Tokens" flow in
docs/README.mdcompletely unreachable. Theonly working add-token path today is Settings -> SettingsAddToken.
Regression introduced by
a22f33d("fix: implement proper view navigationstack (#146)"), which rewrote the import from
{ $, showView, showFlash }to{ $, showFlash, goBack }.Implementation requirements
showViewback to the destructured import inaddToken.js:1. Verifyagainst
src/popup/views/helpers.jsthatshowViewis exported and thatgoBack/showFlashare genuinely still used in this module; drop any thatare not rather than leaving unused imports behind.
AddToken from AddressDetail and pressing "Back" must return to
AddressDetail exactly once, with no stale entry left on the stack.
try/catchor a global.(used-but-not-imported) and are invisible to
make checkbecausescript/lintis onlyprettier --check. The systemic fix is trackedseparately as the ESLint issue; this issue is the point fix only.
Definition of done
token appears in the balance list.
returns to Home (no duplicated or orphaned stack entry).
(no jsdom environment configured), either add the jsdom test env and a
test that
addToken.show()does not throw, or — if that provesdisproportionate — state in the PR why, and ensure the ESLint issue will
catch the class instead.
TODO.mdupdated in the same commit.make checkpasses.clawbot referenced this issue2026-08-10 15:49:44 +02:00