Skip to content

fix: token details loading, caching, and duplicate modal navigation(OK-52689 OK-52688)#11086

Merged
weatherstar merged 18 commits intoxfrom
fix/token-details-x
Apr 8, 2026
Merged

fix: token details loading, caching, and duplicate modal navigation(OK-52689 OK-52688)#11086
weatherstar merged 18 commits intoxfrom
fix/token-details-x

Conversation

@weatherstar
Copy link
Copy Markdown
Contributor

@weatherstar weatherstar commented Apr 7, 2026

Summary

  • Fix token details loading and cached values with proper initResult and isLoading handling
  • Skip redundant updateTokenMetadata when fetch result already exists
  • Prevent duplicate modal navigation with state listener dedup
  • Include params in modal dedupe key and currency in token cache key

Test plan

  • Open token details page, verify history loads correctly with cached data
  • Navigate away and back, confirm cached data displays immediately
  • Rapidly tap token detail to verify no duplicate modals open
  • Switch currency settings and verify history refreshes with new currency

Open with Devin

Prevent the cached-details useEffect from calling updateTokenMetadata
after the fetch promise has already returned real data, avoiding
unnecessary re-renders.
Replace polling-based pending modal tracking with a navigation state
listener for more efficient and reliable duplicate detection. Also fix
findIndex returning undefined when routes is nil.
- Add paramsKey to pending modal target so navigations to the same screen
  with different params are no longer treated as duplicates
- Include currencyInfo.id in token details cache key to avoid showing
  stale fiat values after currency switch
@revan-zhang
Copy link
Copy Markdown
Contributor

revan-zhang commented Apr 7, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@weatherstar weatherstar enabled auto-merge (squash) April 7, 2026 11:42
originalix
originalix previously approved these changes Apr 7, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

- Remove isLoading prop from TxHistoryListView (not in component IProps)
- Derive effectiveInit synchronously to prevent one-frame empty history flash
- Add justification comment for 'state' as any cast in useAppNavigation
@weatherstar weatherstar requested a review from originalix April 8, 2026 03:55
@weatherstar weatherstar merged commit 83f6428 into x Apr 8, 2026
12 checks passed
@weatherstar weatherstar deleted the fix/token-details-x branch April 8, 2026 11:40
PatrickChoo pushed a commit to PatrickChoo/app-monorepo that referenced this pull request Apr 8, 2026
…K-52689 OK-52688) (OneKeyHQ#11086)

* fix token details loading and cached values

* fix: skip redundant updateTokenMetadata when fetch result exists

Prevent the cached-details useEffect from calling updateTokenMetadata
after the fetch promise has already returned real data, avoiding
unnecessary re-renders.

* fix: prevent duplicate modal navigation with state listener dedup

Replace polling-based pending modal tracking with a navigation state
listener for more efficient and reliable duplicate detection. Also fix
findIndex returning undefined when routes is nil.

* fix: include params in modal dedupe key and currency in token cache key

- Add paramsKey to pending modal target so navigations to the same screen
  with different params are no longer treated as duplicates
- Include currencyInfo.id in token details cache key to avoid showing
  stale fiat values after currency switch

* fix: lint
PatrickChoo pushed a commit to PatrickChoo/app-monorepo that referenced this pull request Apr 8, 2026
…K-52689 OK-52688) (OneKeyHQ#11086)

* fix token details loading and cached values

* fix: skip redundant updateTokenMetadata when fetch result exists

Prevent the cached-details useEffect from calling updateTokenMetadata
after the fetch promise has already returned real data, avoiding
unnecessary re-renders.

* fix: prevent duplicate modal navigation with state listener dedup

Replace polling-based pending modal tracking with a navigation state
listener for more efficient and reliable duplicate detection. Also fix
findIndex returning undefined when routes is nil.

* fix: include params in modal dedupe key and currency in token cache key

- Add paramsKey to pending modal target so navigations to the same screen
  with different params are no longer treated as duplicates
- Include currencyInfo.id in token details cache key to avoid showing
  stale fiat values after currency switch

* fix: lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants