From 9a4a83d5ed72b5d979573a3dbec8c70af56b4ba2 Mon Sep 17 00:00:00 2001 From: oobjectt Date: Sat, 10 Dec 2022 22:40:57 +0100 Subject: [PATCH 1/2] Guide - Invite button enabled --- src/components/guide-tool/GuideToolView.scss | 19 ++++++++++++------- .../guide-tool/views/GuideToolOngoingView.tsx | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/guide-tool/GuideToolView.scss b/src/components/guide-tool/GuideToolView.scss index 2b7d0b34..8dfc02ac 100644 --- a/src/components/guide-tool/GuideToolView.scss +++ b/src/components/guide-tool/GuideToolView.scss @@ -20,23 +20,23 @@ .chat-messages { height: 200px; - + .message-avatar { position: relative; overflow: hidden; width: 50px; height: 50px; - + .avatar-image { position: absolute; margin-left: -22px; margin-top: -25px; } } - + .messages-group-left { position: relative; - + &:before { position: absolute; content: ' '; @@ -49,10 +49,10 @@ left: -8px; } } - + .messages-group-right { position: relative; - + &:before { position: absolute; content: ' '; @@ -78,5 +78,10 @@ resize: none; outline: none; line-height: 17px; - } + } + + .text-underline + { + text-decoration: underline; + } } diff --git a/src/components/guide-tool/views/GuideToolOngoingView.tsx b/src/components/guide-tool/views/GuideToolOngoingView.tsx index 080de332..66f6101a 100644 --- a/src/components/guide-tool/views/GuideToolOngoingView.tsx +++ b/src/components/guide-tool/views/GuideToolOngoingView.tsx @@ -76,7 +76,7 @@ export const GuideToolOngoingView: FC = props => { isGuide && - + } { !isGuide && @@ -100,7 +100,7 @@ export const GuideToolOngoingView: FC = props => { (isOwnChat(group.userId)) && GetSessionDataManager().userName } { (!isOwnChat(group.userId)) && userName } - { group.messages.map((chat, index) => { chat.message }) } + { group.messages.map((chat, index) => chat.roomId ? TryVisitRoom(chat.roomId) : null }>{ chat.message }) } { (isOwnChat(group.userId)) && From 48d346173661dfdd2fe9be597bb077cc7ffeea24 Mon Sep 17 00:00:00 2001 From: oobjectt Date: Sat, 10 Dec 2022 22:50:18 +0100 Subject: [PATCH 2/2] Update control if guide is in a room --- src/components/guide-tool/GuideToolView.tsx | 27 ++++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/guide-tool/GuideToolView.tsx b/src/components/guide-tool/GuideToolView.tsx index 5e85f46d..5b48820c 100644 --- a/src/components/guide-tool/GuideToolView.tsx +++ b/src/components/guide-tool/GuideToolView.tsx @@ -199,20 +199,23 @@ export const GuideToolView: FC<{}> = props => { const parser = event.getParser(); - const messageGroups = [ ...ongoingMessageGroups ]; - - let lastGroup = messageGroups[messageGroups.length - 1]; - - const guideId = (isOnDuty ? GetSessionDataManager().userId : ongoingUserId); - - if(!lastGroup || lastGroup.userId !== guideId) + if (parser.roomId !== 0) { - lastGroup = new GuideToolMessageGroup(guideId); - messageGroups.push(lastGroup); - } + const messageGroups = [ ...ongoingMessageGroups ]; - lastGroup.addChat(new GuideToolMessage(parser.roomName, parser.roomId)); - setOngoingMessageGroups(messageGroups); + let lastGroup = messageGroups[messageGroups.length - 1]; + + const guideId = (isOnDuty ? GetSessionDataManager().userId : ongoingUserId); + + if(!lastGroup || lastGroup.userId !== guideId) + { + lastGroup = new GuideToolMessageGroup(guideId); + messageGroups.push(lastGroup); + } + + lastGroup.addChat(new GuideToolMessage(parser.roomName, parser.roomId)); + setOngoingMessageGroups(messageGroups); + } }); useMessageEvent(GuideSessionEndedMessageEvent, event =>