Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(chat/web): add explicit ChatButtonEntry interface and return type to useChatButton hook (#16937)

Nitin Kumar9e3b54ffdfa6
diff --git a/react/features/chat/hooks.web.ts b/react/features/chat/hooks.web.ts
index f912d02179..472c434265 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;
}