Revolution #1

Merged
nuark merged 28 commits from revolution into master 2023-05-08 08:50:16 +03:00
Showing only changes of commit 0c1b4eb885 - Show all commits

View file

@ -799,16 +799,28 @@ class UsersListPanel extends GetView<UserListPanelController> {
final isAdmin =
adminList.any((element) => element.id == user.id);
if (isAdmin) return const SizedBox();
return ElevatedButton.icon(
final isCurrentUser =
user.accessToken == ApiController.to.token;
if (isCurrentUser) return const SizedBox();
final btn = ElevatedButton.icon(
onPressed: () => controller.deleteUser(user),
icon: const Icon(Icons.delete_forever),
label: const Text("Delete user"),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.redAccent,
),
).paddingAll(8).expanded();
);
if (isAdmin) {
return Tooltip(
message: "Please note that this user is an admin",
child: btn,
).paddingAll(8).expanded();
}
return btn.paddingAll(8).expanded();
},
),
],