Skip to content

Commit f6438b1

Browse files
authored
fix(role): default the lookup field to the user's own address; 'AAStar'→'Mycelium' ecosystem (#411)
Role page bug: the Query button did nothing because the lookup field starts empty and queryRole() returns on empty — but users expect it defaulted to their own address. Now loadData prefills queryAddress with the user's account (roleRes.data.address) when the field is empty, so Query works out of the box and can still be changed to look up any address. Also: role page subtitle 'AAStar ecosystem' → 'Mycelium ecosystem' (zh + en), matching the Mycelium Protocol framing. tsc + lint + i18n parity (766 keys) green.
1 parent c27e7a6 commit f6438b1

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

aastar-frontend/app/role/page.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ export default function RolePage() {
9393
registryAPI.getRole().catch(() => null),
9494
registryAPI.getInfo(),
9595
]);
96-
if (roleRes) setRoleInfo(roleRes.data);
96+
if (roleRes) {
97+
setRoleInfo(roleRes.data);
98+
// Default the lookup field to the user's own account so the Query button works
99+
// out of the box (the field looks up ANY address; empty = no-op = "no response").
100+
setQueryAddress(prev => prev || roleRes.data.address || "");
101+
}
97102
setRegistryInfo(infoRes.data);
98103
} catch {
99104
toast.error(t("rolePage.loadError"));

aastar-frontend/lib/i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@
633633
},
634634
"rolePage": {
635635
"title": "Role Portal",
636-
"subtitle": "View your role in the AAStar ecosystem and navigate to role-specific dashboards",
636+
"subtitle": "View your role in the Mycelium ecosystem and navigate to role-specific dashboards",
637637
"registryOverview": "Registry Overview (Sepolia)",
638638
"communityAdmins": "Community Admins",
639639
"spoOperators": "SPO Operators",

aastar-frontend/lib/i18n/locales/zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@
633633
},
634634
"rolePage": {
635635
"title": "角色门户",
636-
"subtitle": "查看您在 AAStar 生态中的角色,并进入相应的角色仪表盘",
636+
"subtitle": "查看您在 Mycelium 生态中的角色,并进入相应的角色仪表盘",
637637
"registryOverview": "注册表概览 (Sepolia)",
638638
"communityAdmins": "社区管理员",
639639
"spoOperators": "SPO 运营商",

0 commit comments

Comments
 (0)