Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
LuizAsFight committed Nov 18, 2024
1 parent 964741d commit 2b6f2a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion packages/app/playwright/e2e/SendTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ test.describe('SendTransaction', () => {

// Select asset
await getButtonByText(page, 'Select one asset').click();
await page.pause();
await page.getByText(ALT_ASSET.name).click();

// Fill address
Expand Down
17 changes: 7 additions & 10 deletions packages/app/src/systems/Asset/cache/AssetsCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,6 @@ export class AssetsCache {
return assetFromDb;
}

const assetFromIndexer = await this.fetchAssetFromIndexer(
endpoint.url,
assetId
).catch((e) => {
console.error('Error fetching asset from indexer', e);
return undefined;
});

if (!assetFromIndexer) return;

const dbAsset = await getFuelAssetByAssetId({
assets: dbAssets.length ? dbAssets : this.dbAssetsCache[chainId],
assetId: assetId,
Expand All @@ -157,6 +147,13 @@ export class AssetsCache {
console.error('Error fetching asset from db', e);
return undefined;
});
const assetFromIndexer = await this.fetchAssetFromIndexer(
endpoint.url,
assetId
).catch((e) => {
console.error('Error fetching asset from indexer', e);
return undefined;
});

const {
isNFT,
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/systems/Send/hooks/useSend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ const schemaFactory = (provider?: Provider) =>
save: false,
});

if (assetCached) {
if (
assetCached &&
AssetsCache.getInstance().assetIsValid(assetCached)
) {
return ctx.createError({
message: `You can't send to Asset address`,
});
Expand Down

0 comments on commit 2b6f2a7

Please sign in to comment.