Skip to content

Commit 8ebf44b

Browse files
authored
fix: Add setting check for Outlook Calendar action reactivity (RocketChat#39986)
1 parent 7183f05 commit 8ebf44b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/nasty-tomatoes-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': patch
3+
---
4+
5+
Fixes an issue where the outlook calendar action isn't being reactive based on the setting
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { useUser } from '@rocket.chat/ui-contexts';
1+
import { useSetting } from '@rocket.chat/ui-contexts';
22
import type { RoomToolboxActionConfig } from '@rocket.chat/ui-contexts';
33
import { lazy, useMemo } from 'react';
44

55
const OutlookEventsRoute = lazy(() => import('../../views/outlookCalendar/OutlookEventsRoute'));
66

77
export const useOutlookCalenderRoomAction = () => {
8-
const user = useUser();
8+
const enabled = useSetting('Outlook_Calendar_Enabled', false);
99

1010
return useMemo((): RoomToolboxActionConfig | undefined => {
11-
if (!user?.settings?.calendar?.outlook?.Enabled) {
11+
if (!enabled) {
1212
return undefined;
1313
}
1414

@@ -20,5 +20,5 @@ export const useOutlookCalenderRoomAction = () => {
2020
tabComponent: OutlookEventsRoute,
2121
order: 999,
2222
};
23-
}, [user?.settings?.calendar?.outlook?.Enabled]);
23+
}, [enabled]);
2424
};

0 commit comments

Comments
 (0)