-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Motivation When a user removes a token, the NNS dapp breaks after navigating to the tokens page. Testing indicates that removing a token triggers navigation to the tokens page because the removed token is then considered as "unknown". **From my observations:** 1. The user clicks “remove.” 2. The component waits for the removal service to complete. 3. The service removes the token from the stores. 4. The store update triggers the navigation. 5. The NNS dapp ends up in an unresolvable state where the wallet component cannot clean up properly because it’s still waiting for the removal service to complete, while the redirection has already occurred, causing the token component to render prematurely. Additionally, navigating while a modal or popup is open also results in a broken state. **Note**: I plan to extend the E2E test to re-import the token after removal to cover this issue. ### Update The main goal of having navigation for unknown tokens is to redirect imported tokens to the /tokens page on sign-out. Since the page reloads in that case, we don’t need to listen for changes throughout the entire session. Therefore, the simplest solution to prevent this confusing state in the NNS dapp is to apply the navigation-on-unknown logic only once, so it isn’t triggered when the user removes a token. # Changes - Apply navigation-on-unknown logic only once. # Tests - Added. # Todos - [ ] Add entry to changelog (if necessary). Not necessary.
- Loading branch information
1 parent
3c14cdb
commit 14e9c14
Showing
3 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters