Skip to content

Commit 9028e5a

Browse files
committed
fix(user-management): adjust role selection logic in user filter dialog
- Remove toggling logic for dashboard role selection - Allow direct setting of role, including null value
1 parent 81ff7a2 commit 9028e5a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lib/user_management/widgets/user_filter_dialog/bloc/user_filter_dialog_bloc.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,9 @@ class UserFilterDialogBloc
7171
UserFilterDialogDashboardRoleChanged event,
7272
Emitter<UserFilterDialogState> emit,
7373
) {
74-
// This logic allows toggling the selection. If the user clicks the
75-
// currently selected role, it deselects it (sets to null), which
76-
// corresponds to the 'Any' state.
77-
final newRole = state.dashboardRole == event.dashboardRole
78-
? null
79-
: event.dashboardRole;
80-
emit(state.copyWith(dashboardRole: newRole));
74+
// Directly set the state to the selected role. The UI's `onSelected`
75+
// will pass `null` when 'Any' is tapped.
76+
emit(state.copyWith(dashboardRole: event.dashboardRole));
8177
}
8278

8379
/// Resets all temporary filter selections in the dialog.

lib/user_management/widgets/user_filter_dialog/user_filter_dialog.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ class _UserFilterDialogState extends State<UserFilterDialog> {
154154
values: const [
155155
DashboardUserRole.admin,
156156
DashboardUserRole.publisher,
157-
DashboardUserRole.none,
158157
],
159158
onSelected: (value) =>
160159
context.read<UserFilterDialogBloc>().add(

0 commit comments

Comments
 (0)