diff --git a/src/components/Widget/HistoryWidget.tsx b/src/components/Widget/HistoryWidget.tsx index 8bd6f53..afe8cea 100644 --- a/src/components/Widget/HistoryWidget.tsx +++ b/src/components/Widget/HistoryWidget.tsx @@ -1,13 +1,9 @@ import { type HistoryWidget as HistoryWidgetType } from 'src/types/widget'; import TableElement from '../Element/Simple/TableElement'; import HistoryMessageElement from '../Element/Complex/HistoryMessageElement'; -import { - getActiveConvoID, - getSelectedElementID, -} from 'src/redux/slices/componentSlice'; +import { getListHistoryChannel } from 'src/redux/slices/componentSlice'; import { useAppSelector } from 'src/redux/hooks'; import { getMessages } from 'src/redux/slices/minimapSlice'; -import { useEffect, useState } from 'react'; type HistoryWidgetProps = { widget: HistoryWidgetType; @@ -16,19 +12,15 @@ type HistoryWidgetProps = { const HistoryWidget = ({ widget }: HistoryWidgetProps) => { const { id, x, y, w, h } = widget; - const convoID = useAppSelector(getActiveConvoID); + const { activeConversationId } = useAppSelector(getListHistoryChannel); const convoMessages = useAppSelector(getMessages).filter( - (message) => message.conversationId === convoID, + (message) => message.conversationId === activeConversationId, ); - const activeElementID = useAppSelector(getSelectedElementID); - useEffect(() => { - console.log('activeElementID: ', activeElementID); - }, [activeElementID]); - - const highlightIndex = convoMessages.findIndex( - (message) => message.id === activeElementID, - ); + // const activeElementID = useAppSelector(getSelectedElementID); + // const highlightIndex = convoMessages.findIndex( + // (message) => message.id === activeElementID, + // ); return (