fix(mobile): filter out revoked authorizations in profile display

Previously, revoked authorizations were still shown in the profile page
because UserAuthorizationSummary.fromList() did not filter by status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-12 04:35:30 -08:00
parent 16f891b743
commit 3eeef11197
1 changed files with 7 additions and 2 deletions

View File

@ -213,7 +213,12 @@ class UserAuthorizationSummary {
AuthorizationResponse? authCityCompany;
AuthorizationResponse? cityCompany;
for (final auth in authorizations) {
//
final activeAuthorizations = authorizations
.where((auth) => auth.status != AuthorizationStatus.revoked)
.toList();
for (final auth in activeAuthorizations) {
switch (auth.roleType) {
case RoleType.community:
community = auth;
@ -239,7 +244,7 @@ class UserAuthorizationSummary {
provinceCompany: provinceCompany,
authCityCompany: authCityCompany,
cityCompany: cityCompany,
allAuthorizations: authorizations,
allAuthorizations: activeAuthorizations,
);
}
}