diff --git a/react/features/chat/hooks.web.ts b/react/features/chat/hooks.web.ts index f912d02179e2..472c43426594 100644 --- a/react/features/chat/hooks.web.ts +++ b/react/features/chat/hooks.web.ts @@ -3,7 +3,13 @@ import { useSelector } from 'react-redux'; import ChatButton from './components/web/ChatButton'; import { isChatDisabled } from './functions'; -const chat = { +interface IChatButtonEntry { + Content: typeof ChatButton; + group: number; + key: string; +} + +const chat: IChatButtonEntry = { key: 'chat', Content: ChatButton, group: 2 @@ -14,10 +20,12 @@ const chat = { * * @returns {Object | undefined} - The chat button object or undefined. */ -export function useChatButton() { +export function useChatButton(): IChatButtonEntry | undefined { const _isChatDisabled = useSelector(isChatDisabled); - if (!_isChatDisabled) { - return chat; + if (_isChatDisabled) { + return; } + + return chat; }