From e81c1bd06ca0053d7b132ee8469b4e30d97441bd Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Fri, 21 Feb 2025 13:18:29 +0000 Subject: [PATCH] Ensure that the Chat pane is disabled for read-only link collaborators (#23785) GitOrigin-RevId: 56e1b1d6b08ec7537386cab0b251e325d681e117 --- .../js/features/ide-react/components/layout/main-layout.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/ide-react/components/layout/main-layout.tsx b/services/web/frontend/js/features/ide-react/components/layout/main-layout.tsx index 78558578d0..3503b446ce 100644 --- a/services/web/frontend/js/features/ide-react/components/layout/main-layout.tsx +++ b/services/web/frontend/js/features/ide-react/components/layout/main-layout.tsx @@ -14,9 +14,11 @@ import { useChatPane } from '@/features/ide-react/hooks/use-chat-pane' import { EditorAndPdf } from '@/features/ide-react/components/editor-and-pdf' import HistoryContainer from '@/features/ide-react/components/history-container' import getMeta from '@/utils/meta' +import { useEditorContext } from '@/shared/context/editor-context' export const MainLayout: FC = () => { const { view } = useLayoutContext() + const { isRestrictedTokenMember } = useEditorContext() const { isOpen: sidebarIsOpen, @@ -39,7 +41,7 @@ export const MainLayout: FC = () => { handlePaneExpand: handleChatExpand, } = useChatPane() - const chatEnabled = getMeta('ol-chatEnabled') + const chatEnabled = getMeta('ol-chatEnabled') && !isRestrictedTokenMember const { t } = useTranslation()