Skip to content

fix(teleport): 修复资产列表显示重复问题并优化兑换信息展示 - #160

Merged
Gaubee merged 2 commits into
mainfrom
fix/teleport-asset-display
Jan 4, 2026
Merged

Gaubee merged 2 commits into
mainfrom
fix/teleport-asset-display

Conversation

@Gaubee

@Gaubee Gaubee commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

问题

后端 assetTypeList API 返回的部分配置中,assetType 字段值与 key 不一致(如 NBT 的 assetType 错误地设为 BFT),导致前端显示重复的资产名称。

修复内容

1. 数据层修复 (hooks.ts)

  • 使用 API 返回的 key(如 NBT)作为 symbol 和 assetType
  • 防御性修复,即使后端数据有问题也能正确显示

2. UI 优化 (App.tsx)

  • 资产卡片标题显示:NBT → BFM(输入资产 → 输出资产)
  • 显示兑换比例:1 NBT = 0.2 BFM
  • 新增说明文案:「BFM 生态基金会社区代币兑换」

3. i18n 更新

  • 同步更新 zh-CN、zh、zh-TW、en 语言文件
  • 新增 selectDesc、ratio 等文案

预期效果

输入资产 显示标题 显示比例
BFCHAINV2.BFT BFT → BFM 1 BFT = 0.0416 BFM
BFCHAINV2.NBT NBT → BFM 1 NBT = 0.2 BFM

测试

  • TypeScript 类型检查通过
  • ESLint 检查通过(无新增错误)
  • 单元测试全部通过(31/31)

Gaubee added 2 commits January 4, 2026 17:01
- 使用 API 返回的 key 作为资产类型,而非可能错误的 assetType 字段
- 资产卡片显示「输入资产 → 输出资产」格式
- 显示兑换比例:1 NBT = 0.2 BFM
- 添加「BFM 生态基金会社区代币兑换」说明文案
- 同步更新中英文及繁体中文语言文件
@Gaubee
Gaubee merged commit 40b73fe into main Jan 4, 2026
5 checks passed
@Gaubee
Gaubee deleted the fix/teleport-asset-display branch January 4, 2026 09:09
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.

1 participant