diff --git a/apps/meteor/client/hooks/useRoomInfoEndpoint.ts b/apps/meteor/client/hooks/useRoomInfoEndpoint.ts index fbce560fd327f..ac448d0cc3c8b 100644 --- a/apps/meteor/client/hooks/useRoomInfoEndpoint.ts +++ b/apps/meteor/client/hooks/useRoomInfoEndpoint.ts @@ -4,9 +4,10 @@ import { useEndpoint, useUserId } from '@rocket.chat/ui-contexts'; import type { UseQueryResult } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query'; import { minutesToMilliseconds } from 'date-fns'; -import type { Meteor } from 'meteor/meteor'; -export const useRoomInfoEndpoint = (rid: IRoom['_id']): UseQueryResult> => { +type APIErrorResult = { success: boolean; error: string }; + +export const useRoomInfoEndpoint = (rid: IRoom['_id']): UseQueryResult, APIErrorResult> => { const getRoomInfo = useEndpoint('GET', '/v1/rooms.info'); const uid = useUserId(); return useQuery({ @@ -15,7 +16,7 @@ export const useRoomInfoEndpoint = (rid: IRoom['_id']): UseQueryResult { + retry: (count, error) => { if (count > 2 || error.error === 'not-allowed') { return false; }