♻️(frontend) remove deprecated chat options

Changes introduced by LiveKit which deprecated some chat's options.
As we duplicated their code, let's just removed them.
They are not useful, and not in use anywhere.
This commit is contained in:
lebaudantoine
2024-10-11 17:55:07 +02:00
committed by aleb_the_flash
parent 2f3e64b389
commit 1a52221ef2
2 changed files with 2 additions and 20 deletions

View File

@@ -30,21 +30,11 @@ export interface ChatProps
* ```
* @public
*/
export function Chat({
messageFormatter,
messageDecoder,
messageEncoder,
channelTopic,
...props
}: ChatProps) {
export function Chat({ messageFormatter, ...props }: ChatProps) {
const inputRef = React.useRef<HTMLTextAreaElement>(null)
const ulRef = React.useRef<HTMLUListElement>(null)
const chatOptions: ChatOptions = React.useMemo(() => {
return { messageDecoder, messageEncoder, channelTopic }
}, [messageDecoder, messageEncoder, channelTopic])
const { send, chatMessages, isSending } = useChat(chatOptions)
const { send, chatMessages, isSending } = useChat()
const layoutContext = useMaybeLayoutContext()
const lastReadMsgAt = React.useRef<ChatMessage['timestamp']>(0)

View File

@@ -1,6 +1,4 @@
import type {
MessageDecoder,
MessageEncoder,
TrackReferenceOrPlaceholder,
WidgetState,
} from '@livekit/components-core'
@@ -55,8 +53,6 @@ const LayoutWrapper = styled(
export interface VideoConferenceProps
extends React.HTMLAttributes<HTMLDivElement> {
chatMessageFormatter?: MessageFormatter
chatMessageEncoder?: MessageEncoder
chatMessageDecoder?: MessageDecoder
/** @alpha */
SettingsComponent?: React.ComponentType
}
@@ -81,8 +77,6 @@ export interface VideoConferenceProps
*/
export function VideoConference({
chatMessageFormatter,
chatMessageDecoder,
chatMessageEncoder,
...props
}: VideoConferenceProps) {
const [widgetState, setWidgetState] = React.useState<WidgetState>({
@@ -220,8 +214,6 @@ export function VideoConference({
<Chat
style={{ display: widgetState.showChat ? 'grid' : 'none' }}
messageFormatter={chatMessageFormatter}
messageEncoder={chatMessageEncoder}
messageDecoder={chatMessageDecoder}
/>
{sidePanel && <SidePanel />}
</LayoutWrapper>