From 515227254aacc9f24004f193d46f4ae335f29529 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 27 Mar 2022 23:21:06 -0400 Subject: [PATCH] Default chat settings fix --- src/components/room/widgets/chat/ChatWidgetView.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/room/widgets/chat/ChatWidgetView.tsx b/src/components/room/widgets/chat/ChatWidgetView.tsx index 93c23158..d552449c 100644 --- a/src/components/room/widgets/chat/ChatWidgetView.tsx +++ b/src/components/room/widgets/chat/ChatWidgetView.tsx @@ -1,6 +1,6 @@ import { GetGuestRoomResultEvent, IWorkerEventTracker, NitroPoint, RoomChatSettings, RoomChatSettingsEvent, RoomDragEvent } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useRef, useState } from 'react'; -import { AddWorkerEventTracker, GetConfiguration, RemoveWorkerEventTracker, RoomChatFormatter, RoomWidgetChatSelectAvatarMessage, RoomWidgetRoomObjectMessage, RoomWidgetUpdateChatEvent, SendWorkerEvent } from '../../../../api'; +import { AddWorkerEventTracker, GetConfiguration, IRoomChatSettings, RemoveWorkerEventTracker, RoomChatFormatter, RoomWidgetChatSelectAvatarMessage, RoomWidgetRoomObjectMessage, RoomWidgetUpdateChatEvent, SendWorkerEvent } from '../../../../api'; import { UseEventDispatcherHook, UseMessageEventHook, UseRoomEngineEvent } from '../../../../hooks'; import { useRoomContext } from '../../RoomContext'; import { ChatWidgetMessageView } from './ChatWidgetMessageView'; @@ -11,7 +11,13 @@ let TIMER_TRACKER: number = 0; export const ChatWidgetView: FC<{}> = props => { - const [ chatSettings, setChatSettings ] = useState(null); + const [ chatSettings, setChatSettings ] = useState({ + mode: RoomChatSettings.CHAT_MODE_FREE_FLOW, + weight: RoomChatSettings.CHAT_BUBBLE_WIDTH_NORMAL, + speed: RoomChatSettings.CHAT_SCROLL_SPEED_NORMAL, + distance: 50, + protection: RoomChatSettings.FLOOD_FILTER_NORMAL + }); const [ chatMessages, setChatMessages ] = useState([]); const [ timerId, setTimerId ] = useState(TIMER_TRACKER++); const { roomSession = null, eventDispatcher = null, widgetHandler = null } = useRoomContext(); @@ -230,7 +236,7 @@ export const ChatWidgetView: FC<{}> = props => return (
- {chatMessages.map(chat => )} + {chatMessages.map(chat => )}
); }