diff --git a/.changeset/smooth-lobsters-flash.md b/.changeset/smooth-lobsters-flash.md
new file mode 100644
index 0000000000000..541d5069ee9c2
--- /dev/null
+++ b/.changeset/smooth-lobsters-flash.md
@@ -0,0 +1,5 @@
+---
+'@rocket.chat/meteor': patch
+---
+
+Fix show correct user roles after updating user roles on admin edit user panel.
diff --git a/apps/meteor/client/views/admin/users/AdminUserFormWithData.tsx b/apps/meteor/client/views/admin/users/AdminUserFormWithData.tsx
index 63fe2691d9720..e595acc469511 100644
--- a/apps/meteor/client/views/admin/users/AdminUserFormWithData.tsx
+++ b/apps/meteor/client/views/admin/users/AdminUserFormWithData.tsx
@@ -1,6 +1,7 @@
import type { IUser } from '@rocket.chat/core-typings';
import { isUserFederated } from '@rocket.chat/core-typings';
import { Box, Callout } from '@rocket.chat/fuselage';
+import { useEffectEvent } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React from 'react';
@@ -16,7 +17,12 @@ type AdminUserFormWithDataProps = {
const AdminUserFormWithData = ({ uid, onReload }: AdminUserFormWithDataProps): ReactElement => {
const t = useTranslation();
- const { data, isLoading, isError } = useUserInfoQuery({ userId: uid });
+ const { data, isLoading, isError, refetch } = useUserInfoQuery({ userId: uid });
+
+ const handleReload = useEffectEvent(() => {
+ onReload();
+ refetch();
+ });
if (isLoading) {
return (
@@ -42,7 +48,7 @@ const AdminUserFormWithData = ({ uid, onReload }: AdminUserFormWithDataProps): R
);
}
- return ;
+ return ;
};
export default AdminUserFormWithData;