diff --git a/.changeset/eleven-laws-crash.md b/.changeset/eleven-laws-crash.md new file mode 100644 index 0000000000000..d13835ed795f6 --- /dev/null +++ b/.changeset/eleven-laws-crash.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue where the outlook calendar items list is not rendering properly diff --git a/apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventsList.tsx b/apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventsList.tsx index 63acdb3b5a638..35bbad58c4f1d 100644 --- a/apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventsList.tsx +++ b/apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventsList.tsx @@ -1,4 +1,4 @@ -import { Box, States, StatesIcon, StatesTitle, StatesSubtitle, ButtonGroup, Button } from '@rocket.chat/fuselage'; +import { Box, States, StatesIcon, StatesTitle, StatesSubtitle, ButtonGroup, Button, Throbber } from '@rocket.chat/fuselage'; import { useResizeObserver } from '@rocket.chat/fuselage-hooks'; import { useTranslation, useSetting } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -12,7 +12,6 @@ import { ContextualbarClose, ContextualbarContent, ContextualbarFooter, - ContextualbarSkeleton, } from '../../../components/Contextualbar'; import { VirtualizedScrollbars } from '../../../components/CustomScrollbars'; import { getErrorMessage } from '../../../lib/errorHandling'; @@ -40,10 +39,6 @@ const OutlookEventsList = ({ onClose, changeRoute }: OutlookEventsListProps): Re debounceDelay: 200, }); - if (calendarListResult.isLoading) { - return ; - } - const calendarEvents = calendarListResult.data; const total = calendarEvents?.length || 0; @@ -54,87 +49,57 @@ const OutlookEventsList = ({ onClose, changeRoute }: OutlookEventsListProps): Re {t('Outlook_calendar')} - - {hasOutlookMethods && !authEnabled && total === 0 && ( - <> - - - - - {t('Log_in_to_sync')} - - - - - - - - - - - - )} - - {(authEnabled || !hasOutlookMethods) && ( - <> - - {(total === 0 || calendarListResult.isError) && ( - - {calendarListResult.isError && ( - - - {t('Something_went_wrong')} - {getErrorMessage(calendarListResult.error)} - - )} - {!calendarListResult.isError && total === 0 && ( - - - {t('No_history')} - - )} - - )} - {calendarListResult.isSuccess && calendarListResult.data.length > 0 && ( - - - } - /> - - - )} - - + + + {calendarListResult.isPending && } + {calendarListResult.isError && ( + + + {t('Something_went_wrong')} + {getErrorMessage(calendarListResult.error)} + + )} + {!calendarListResult.isPending && total === 0 && ( + + + {t('No_history')} + + )} + {calendarListResult.isSuccess && calendarListResult.data.length > 0 && ( + + } + /> + + )} + + + + + {authEnabled && } + {outlookUrl && ( + + )} + + {hasOutlookMethods && ( + - {authEnabled && } - {outlookUrl && ( - - )} + - {hasOutlookMethods && ( - - - - - - )} - - - )} + + )} + ); };