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:
parent
16f891b743
commit
3eeef11197
|
|
@ -213,7 +213,12 @@ class UserAuthorizationSummary {
|
||||||
AuthorizationResponse? authCityCompany;
|
AuthorizationResponse? authCityCompany;
|
||||||
AuthorizationResponse? cityCompany;
|
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) {
|
switch (auth.roleType) {
|
||||||
case RoleType.community:
|
case RoleType.community:
|
||||||
community = auth;
|
community = auth;
|
||||||
|
|
@ -239,7 +244,7 @@ class UserAuthorizationSummary {
|
||||||
provinceCompany: provinceCompany,
|
provinceCompany: provinceCompany,
|
||||||
authCityCompany: authCityCompany,
|
authCityCompany: authCityCompany,
|
||||||
cityCompany: cityCompany,
|
cityCompany: cityCompany,
|
||||||
allAuthorizations: authorizations,
|
allAuthorizations: activeAuthorizations,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue