diff --git a/src/components/guide-tool/views/GuideToolOngoingView.tsx b/src/components/guide-tool/views/GuideToolOngoingView.tsx index a2626063..b85c15ef 100644 --- a/src/components/guide-tool/views/GuideToolOngoingView.tsx +++ b/src/components/guide-tool/views/GuideToolOngoingView.tsx @@ -1,8 +1,8 @@ -import { GuideSessionGetRequesterRoomMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer } from '@nitrots/nitro-renderer'; +import { GuideSessionGetRequesterRoomMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionMessageMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer } from '@nitrots/nitro-renderer'; import { FC, KeyboardEvent, useCallback, useEffect, useRef, useState } from 'react'; -import { ChatEntryType, ChatHistoryCurrentDate, GetSessionDataManager, GuideToolMessageGroup, LocalizeText, ReportType, SendMessageComposer, TryVisitRoom } from '../../../api'; +import { GetSessionDataManager, GuideToolMessageGroup, LocalizeText, ReportType, SendMessageComposer, TryVisitRoom } from '../../../api'; import { Base, Button, ButtonGroup, Column, Flex, LayoutAvatarImageView, Text } from '../../../common'; -import { useChatHistory, useHelp, useMessageEvent, useRoom } from '../../../hooks'; +import { useHelp, useMessageEvent } from '../../../hooks'; interface GuideToolOngoingViewProps { @@ -21,8 +21,6 @@ export const GuideToolOngoingView: FC = props => const { isGuide = false, userId = 0, userName = null, userFigure = null, isTyping = false, messageGroups = [] } = props; const [ messageText, setMessageText ] = useState(''); - const { addMessengerEntry } = useChatHistory(); - const { roomSession = null } = useRoom(); const { report = null } = useHelp(); useEffect(() => @@ -53,13 +51,6 @@ export const GuideToolOngoingView: FC = props => TryVisitRoom(parser.requesterRoomId); }); - useMessageEvent(GuideSessionMessageMessageEvent, event => - { - const parser = event.getParser(); - - addMessengerEntry({ id: -1, webId: parser.senderId, entityId: -1, name: userName, timestamp: ChatHistoryCurrentDate(), type: ChatEntryType.TYPE_IM, roomId: !roomSession ? 0 : roomSession.roomId, message: parser.chatMessage }); - }); - const sendMessage = useCallback(() => { if(!messageText || !messageText.length) return; diff --git a/src/components/help/views/ReportSummaryView.tsx b/src/components/help/views/ReportSummaryView.tsx index 6ee64e08..c387ffe4 100644 --- a/src/components/help/views/ReportSummaryView.tsx +++ b/src/components/help/views/ReportSummaryView.tsx @@ -14,7 +14,6 @@ export const ReportSummaryView: FC<{}> = props => switch(activeReport.reportType) { - case ReportType.BULLY: case ReportType.EMERGENCY: case ReportType.ROOM: { @@ -40,9 +39,7 @@ export const ReportSummaryView: FC<{}> = props => SendMessageComposer(new CallForHelpFromPhotoMessageComposer(activeReport.extraData, activeReport.cfhTopic, activeReport.roomId, GetSessionDataManager().userId, activeReport.roomObjectId)); break; case ReportType.GUIDE: - activeReport.reportedChats.forEach(entry => chats.push(entry.webId, entry.message)); - - SendMessageComposer(new GuideSessionReportMessageComposer(activeReport.message)); + SendMessageComposer(new GuideSessionReportMessageComposer('')); break; } diff --git a/src/components/help/views/SelectReportedChatsView.tsx b/src/components/help/views/SelectReportedChatsView.tsx index 37067048..8873f167 100644 --- a/src/components/help/views/SelectReportedChatsView.tsx +++ b/src/components/help/views/SelectReportedChatsView.tsx @@ -18,7 +18,6 @@ export const SelectReportedChatsView: FC<{}> = props => case ReportType.EMERGENCY: return chatHistory.filter(chat => (chat.type === ChatEntryType.TYPE_CHAT) && (chat.webId === activeReport.reportedUserId) && (chat.entityType === RoomObjectType.USER)); case ReportType.IM: - case ReportType.GUIDE: return messengerHistory.filter(chat => (chat.webId === activeReport.reportedUserId) && (chat.type === ChatEntryType.TYPE_IM)); } diff --git a/src/hooks/chat-history/useChatHistory.ts b/src/hooks/chat-history/useChatHistory.ts index d1e632da..65cdd672 100644 --- a/src/hooks/chat-history/useChatHistory.ts +++ b/src/hooks/chat-history/useChatHistory.ts @@ -98,7 +98,7 @@ const useChatHistoryState = () => addMessengerEntry({ id: -1, webId: parser.senderId, entityId: -1, name: '', message: parser.messageText, roomId: -1, timestamp: MessengerHistoryCurrentDate(), type: ChatEntryType.TYPE_IM }); }); - return { addChatEntry, chatHistory, roomHistory, messengerHistory, addMessengerEntry }; + return { addChatEntry, chatHistory, roomHistory, messengerHistory }; } export const useChatHistory = () => useBetween(useChatHistoryState);