From 3eeef111971755656c6ac4d938f89bcbd3fc0af1 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 12 Dec 2025 04:35:30 -0800 Subject: [PATCH] fix(mobile): filter out revoked authorizations in profile display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../lib/core/services/authorization_service.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/mobile-app/lib/core/services/authorization_service.dart b/frontend/mobile-app/lib/core/services/authorization_service.dart index 64ac0449..8e74accf 100644 --- a/frontend/mobile-app/lib/core/services/authorization_service.dart +++ b/frontend/mobile-app/lib/core/services/authorization_service.dart @@ -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, ); } }