Skip to content

Commit

Permalink
Merge branch 'master' into nj/feat/allow-multiple-networks-with-the-s…
Browse files Browse the repository at this point in the history
…ame-name
  • Loading branch information
nelitow authored Jan 6, 2025
2 parents 776ab55 + 4c53007 commit 4da0b0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-grapes-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels-wallet": minor
---

Improve handling of custom assets.
7 changes: 5 additions & 2 deletions packages/app/src/systems/Asset/cache/AssetsCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ export class AssetsCache {
if (
cachedEntry?.name !== undefined &&
cachedEntry.fetchedAt &&
now - cachedEntry.fetchedAt < FIVE_MINUTES
now - cachedEntry.fetchedAt < FIVE_MINUTES &&
!cachedEntry.isCustom &&
cachedEntry?.name !== ''
) {
return cachedEntry;
}
Expand All @@ -145,7 +147,8 @@ export class AssetsCache {
if (
assetFromDb?.name &&
assetFromDb.fetchedAt &&
now - assetFromDb.fetchedAt < FIVE_MINUTES
now - assetFromDb.fetchedAt < FIVE_MINUTES &&
!assetFromDb.isCustom
) {
this.cache[chainId][assetId] = assetFromDb;
return assetFromDb as FuelCachedAsset;
Expand Down

0 comments on commit 4da0b0a

Please sign in to comment.