Skip to content

Commit

Permalink
Fix: association edition for presidents (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotheem authored Jan 3, 2025
1 parent 7412931 commit fb82bbe
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class AssociationEditorPage extends HookConsumerWidget {
final completeMemberNotifier = ref.watch(completeMemberProvider.notifier);
final memberRoleTagsNotifier = ref.watch(memberRoleTagsProvider.notifier);
final isPhonebookAdmin = ref.watch(isPhonebookAdminProvider);
final isAssociationPresident = ref.watch(isAssociationPresidentProvider);

void displayToastWithContext(TypeMsg type, String msg) {
displayToast(context, type, msg);
Expand Down Expand Up @@ -98,14 +99,16 @@ class AssociationEditorPage extends HookConsumerWidget {
width: 40,
height: 40,
decoration: BoxDecoration(
color: isPhonebookAdmin && !association.deactivated
color: (isPhonebookAdmin || isAssociationPresident) &&
!association.deactivated
? ColorConstants.gradient1
: ColorConstants.deactivated1,
borderRadius: BorderRadius.circular(10),
),
child: child,
),
onTap: isPhonebookAdmin && !association.deactivated
onTap: (isPhonebookAdmin || isAssociationPresident) &&
!association.deactivated
? () async {
rolesTagsNotifier.resetChecked();
memberRoleTagsNotifier.reset();
Expand Down Expand Up @@ -150,7 +153,8 @@ class AssociationEditorPage extends HookConsumerWidget {
builder: (context, associationMembers) => associationMembers
.isEmpty
? const Text(PhonebookTextConstants.noMember)
: isPhonebookAdmin && !association.deactivated
: (isPhonebookAdmin || isAssociationPresident) &&
!association.deactivated
? SizedBox(
height: 400,
child: ReorderableListView(
Expand Down

0 comments on commit fb82bbe

Please sign in to comment.