mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-30 00:50:50 +01:00
Update control if guide is in a room
This commit is contained in:
parent
9a4a83d5ed
commit
48d3461736
@ -199,20 +199,23 @@ export const GuideToolView: FC<{}> = props =>
|
|||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
const messageGroups = [ ...ongoingMessageGroups ];
|
if (parser.roomId !== 0)
|
||||||
|
|
||||||
let lastGroup = messageGroups[messageGroups.length - 1];
|
|
||||||
|
|
||||||
const guideId = (isOnDuty ? GetSessionDataManager().userId : ongoingUserId);
|
|
||||||
|
|
||||||
if(!lastGroup || lastGroup.userId !== guideId)
|
|
||||||
{
|
{
|
||||||
lastGroup = new GuideToolMessageGroup(guideId);
|
const messageGroups = [ ...ongoingMessageGroups ];
|
||||||
messageGroups.push(lastGroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
lastGroup.addChat(new GuideToolMessage(parser.roomName, parser.roomId));
|
let lastGroup = messageGroups[messageGroups.length - 1];
|
||||||
setOngoingMessageGroups(messageGroups);
|
|
||||||
|
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>(GuideSessionEndedMessageEvent, event =>
|
useMessageEvent<GuideSessionEndedMessageEvent>(GuideSessionEndedMessageEvent, event =>
|
||||||
|
Loading…
Reference in New Issue
Block a user