Skip to content

Commit

Permalink
Merge branch 'develop' into feat/videoconf-persistent-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Jul 23, 2024
2 parents bc69685 + 1195dc2 commit 09aec45
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-lobsters-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fix show correct user roles after updating user roles on admin edit user panel.
10 changes: 8 additions & 2 deletions apps/meteor/client/views/admin/users/AdminUserFormWithData.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 (
Expand All @@ -42,7 +48,7 @@ const AdminUserFormWithData = ({ uid, onReload }: AdminUserFormWithDataProps): R
);
}

return <AdminUserForm userData={data?.user} onReload={onReload} />;
return <AdminUserForm userData={data?.user} onReload={handleReload} />;
};

export default AdminUserFormWithData;

0 comments on commit 09aec45

Please sign in to comment.