diff --git a/lib/pages/home_panels/users_list_panel.dart b/lib/pages/home_panels/users_list_panel.dart index 161ad6f..5624918 100644 --- a/lib/pages/home_panels/users_list_panel.dart +++ b/lib/pages/home_panels/users_list_panel.dart @@ -799,16 +799,28 @@ class UsersListPanel extends GetView { 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(); }, ), ],