Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions react/features/chat/hooks.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}