From a4d1a051b4ee006327c59980ad6bb7ef973c51d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=87=E3=83=B4=E3=81=81=E3=82=93=E3=81=99?= Date: Fri, 13 Oct 2023 12:09:27 +0530 Subject: [PATCH] remove re-render key --- .../admin/moderation/UserReports/ModConsoleUserTableRow.tsx | 5 ++--- .../admin/moderation/UserReports/ModConsoleUsersTable.tsx | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUserTableRow.tsx b/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUserTableRow.tsx index 134d2c310ea1..f1981a4360ba 100644 --- a/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUserTableRow.tsx +++ b/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUserTableRow.tsx @@ -10,10 +10,9 @@ export type ModConsoleUserRowProps = { report: Pick & { count: number }; onClick: (id: IUser['_id']) => void; isDesktopOrLarger: boolean; - avatarUpdateKey?: number; }; -const ModConsoleUserTableRow = ({ report, onClick, isDesktopOrLarger, avatarUpdateKey }: ModConsoleUserRowProps): JSX.Element => { +const ModConsoleUserTableRow = ({ report, onClick, isDesktopOrLarger }: ModConsoleUserRowProps): JSX.Element => { const { reportedUser } = report; const { _id, username, name, createdAt, emails } = reportedUser; const { count, ts } = report; @@ -23,7 +22,7 @@ const ModConsoleUserTableRow = ({ report, onClick, isDesktopOrLarger, avatarUpda return ( onClick(_id)} tabIndex={0} role='link' action> - + {formatDateAndTime(createdAt)} {emails?.[0].address} diff --git a/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUsersTable.tsx b/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUsersTable.tsx index eabc8a4f3963..1aea6b2cffd7 100644 --- a/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUsersTable.tsx +++ b/apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUsersTable.tsx @@ -55,14 +55,12 @@ const ModConsoleUsersTable: FC = () => { const dispatchToastMessage = useToastMessageDispatch(); - const { data, isLoading, isSuccess, dataUpdatedAt } = useQuery(['moderation.userReports', query], async () => getReports(query), { + const { data, isLoading, isSuccess } = useQuery(['moderation.userReports', query], async () => getReports(query), { onError: (error) => { dispatchToastMessage({ type: 'error', message: error }); }, }); - const debouncedUpdatedAt = useDebouncedValue(dataUpdatedAt, 1000); - const handleClick = useMutableCallback((id): void => { router.navigate({ name: 'moderation-console', @@ -123,7 +121,6 @@ const ModConsoleUsersTable: FC = () => { report={report as unknown as ModConsoleUserRowProps['report']} onClick={handleClick} isDesktopOrLarger={isDesktopOrLarger} - avatarUpdateKey={debouncedUpdatedAt} /> ))}