diff --git a/client/src/ActionsAndReducers/playerUi/playerUi_Reducer.ts b/client/src/ActionsAndReducers/playerUi/playerUi_Reducer.ts index 8d54af7ca5..e3f456ef5e 100644 --- a/client/src/ActionsAndReducers/playerUi/playerUi_Reducer.ts +++ b/client/src/ActionsAndReducers/playerUi/playerUi_Reducer.ts @@ -90,7 +90,7 @@ const actionHandlers: Record = { newState.feedbackMessages = (action as SetWargameFeedbackAction).payload }, [SET_LATEST_FEEDBACK_MESSAGE]: (newState, action) => { - newState.feedbackMessages.unshift( + newState.feedbackMessages.push( (action as SetLatestFeedbackMessageAction).payload ) }, diff --git a/client/src/Components/CoreMappingChannel.tsx b/client/src/Components/CoreMappingChannel.tsx index 69a0556bf4..5ed6a9395a 100644 --- a/client/src/Components/CoreMappingChannel.tsx +++ b/client/src/Components/CoreMappingChannel.tsx @@ -52,7 +52,6 @@ const CoreMappingChannel: React.FC<{ channelId: string }> = ({ channelId }) => { const messageHandler = (message: MappingMessage | MappingMessageDelta): void => { sendMappingMessage(state.currentWargame, message) } - const coreMappingComponent = useMemo(() => { return = ({ messages, channel, playerForce, play const custMessage = message as MappingMessage | MappingMessageDelta return custMessage.messageType === MAPPING_MESSAGE || custMessage.messageType === MAPPING_MESSAGE_DELTA } else return false - }) + }).reverse() + if (mappingMessages.length) { const mappingMessage = mappingMessages.find((msg: Message) => msg.messageType === MAPPING_MESSAGE) if (mappingMessage) { diff --git a/client/src/Helpers/handle-channel-updates.ts b/client/src/Helpers/handle-channel-updates.ts index f936873ac4..b44b5dc444 100644 --- a/client/src/Helpers/handle-channel-updates.ts +++ b/client/src/Helpers/handle-channel-updates.ts @@ -1,4 +1,4 @@ -import { CHANNEL_CHAT, CHANNEL_COLLAB, CHAT_CHANNEL_ID, CUSTOM_MESSAGE, expiredStorage, INFO_MESSAGE, INFO_MESSAGE_CLIPPED } from 'src/config' +import { CHANNEL_COLLAB, CHAT_CHANNEL_ID, CUSTOM_MESSAGE, expiredStorage, INFO_MESSAGE, INFO_MESSAGE_CLIPPED } from 'src/config' import { ChannelTypes, ChannelUI, ForceData, MessageChannel, MessageCustom, MessageInfoType, MessageInfoTypeClipped, PlayerMessage, PlayerMessageLog, PlayerUiChannels, PlayerUiChatChannel, Role, SetWargameMessage, TemplateBodysByKey @@ -86,11 +86,8 @@ const handleNonInfoMessage = (data: SetWargameMessage, channel: string, message: const present = theChannel.messages.some((msg: MessageChannel) => msg._id === message._id) if (!present) { // chat messages need to go at the end, not the start - if (theChannel.cData.channelType === CHANNEL_CHAT) { - theChannel.messages.push(newObj) - } else { - theChannel.messages.unshift(newObj) - } + theChannel.messages.push(newObj) + // update message count, if it's not from us if (!ourMessage) { theChannel.unreadMessageCount = (theChannel.unreadMessageCount || 0) + 1