|
@@ -25,7 +25,8 @@ import ForwardBar from "./ForwardBar";
|
|
import EditBar from "./EditBar";
|
|
import EditBar from "./EditBar";
|
|
import {
|
|
import {
|
|
sentMessageById, sentImgMessageById, sentAudioMessageById,
|
|
sentMessageById, sentImgMessageById, sentAudioMessageById,
|
|
- sentVideoMessageById,sentFileMessageById,sentMessageReplyById,sentMessageForwardById
|
|
|
|
|
|
+ sentVideoMessageById, sentFileMessageById, sentMessageEditById,
|
|
|
|
+ sentMessageReplyById, sentMessageForwardById
|
|
} from '../../../../../api-data'
|
|
} from '../../../../../api-data'
|
|
import { getChat } from '../../../../../redux/chat/selector'
|
|
import { getChat } from '../../../../../redux/chat/selector'
|
|
import { getRightIsOpen } from '../../../../../redux/control/selector'
|
|
import { getRightIsOpen } from '../../../../../redux/control/selector'
|
|
@@ -346,8 +347,8 @@ const SendMessage = ({isArrow,silentMode,isReply,setIsReply,isForward,setIsForwa
|
|
sentMessageForwardById(isForward._id,isForward.companionIdForwardToAndFrom,value,caption.trim())
|
|
sentMessageForwardById(isForward._id,isForward.companionIdForwardToAndFrom,value,caption.trim())
|
|
setIsForward(undefined)
|
|
setIsForward(undefined)
|
|
}
|
|
}
|
|
- if (value&&isEdit && !isForward && !isReply) {
|
|
|
|
- //sent edited messages
|
|
|
|
|
|
+ if (isEdit && !isForward && !isReply) {
|
|
|
|
+ sentMessageEditById(isEdit._id, value, caption.trim())
|
|
setIsEdit(undefined)
|
|
setIsEdit(undefined)
|
|
}
|
|
}
|
|
if (mediaBlobUrl && type === 'recording') {
|
|
if (mediaBlobUrl && type === 'recording') {
|
|
@@ -523,10 +524,10 @@ const SendMessage = ({isArrow,silentMode,isReply,setIsReply,isForward,setIsForwa
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
const companionIdForwardToAndFrom = isForward?.companionIdForwardToAndFrom
|
|
const companionIdForwardToAndFrom = isForward?.companionIdForwardToAndFrom
|
|
if(companionIdForwardToAndFrom&&companionIdForwardToAndFrom !== companionId) setIsForward(undefined)
|
|
if(companionIdForwardToAndFrom&&companionIdForwardToAndFrom !== companionId) setIsForward(undefined)
|
|
- },[companionId])
|
|
|
|
|
|
+ }, [companionId])
|
|
|
|
|
|
return (
|
|
return (
|
|
- <div className={(isEdit&&value&&(isEdit.message !== value)) || (isEdit&&caption&&(isEdit.caption !== caption)) || (value&&!isEdit) || file || status === 'stopped' || _status === 'stopped' ?classes.containerActive:classes.container}>
|
|
|
|
|
|
+ <div className={(value&&isEdit&&isEdit.type === 'text') || (isEdit&&isEdit.type !== 'text') || (value&&!isEdit) || file || status === 'stopped' || _status === 'stopped' ?classes.containerActive:classes.container}>
|
|
{isArrow && <div className={classes.borderTop}></div>}
|
|
{isArrow && <div className={classes.borderTop}></div>}
|
|
{isReply && <ReplyBar isReply={isReply} handleCloseReply={handleCloseReply}
|
|
{isReply && <ReplyBar isReply={isReply} handleCloseReply={handleCloseReply}
|
|
handleScrollToTheMessage={handleScrollToTheMessage} />}
|
|
handleScrollToTheMessage={handleScrollToTheMessage} />}
|
|
@@ -569,7 +570,7 @@ const SendMessage = ({isArrow,silentMode,isReply,setIsReply,isForward,setIsForwa
|
|
style={{ display: status !== null || _status === 'stopped' || file || value || isFilming || isReply || isForward || isEdit? 'none' : 'block' }} />
|
|
style={{ display: status !== null || _status === 'stopped' || file || value || isFilming || isReply || isForward || isEdit? 'none' : 'block' }} />
|
|
<SendIcon onClick={sentMessage} className={classes.avatarRight}
|
|
<SendIcon onClick={sentMessage} className={classes.avatarRight}
|
|
sx={{backgroundColor: '#ffffff',color: 'rgb(41, 139, 231)', width: 56, height: 56}}
|
|
sx={{backgroundColor: '#ffffff',color: 'rgb(41, 139, 231)', width: 56, height: 56}}
|
|
- style={{display: (isEdit&&value&&(isEdit.message !== value)) || (isEdit&&caption&&(isEdit.caption !== caption)) || (value&&!isEdit) || file || status === 'stopped' || _status === 'stopped'? 'block':'none' }}/>
|
|
|
|
|
|
+ style={{display: (value&&isEdit&&isEdit.type === 'text') || (isEdit&&isEdit.type !== 'text') || (value&&!isEdit) || file || status === 'stopped' || _status === 'stopped'? 'block':'none' }}/>
|
|
<MicNoneIcon onClick={handleRecording} className={classes.avatarRight}
|
|
<MicNoneIcon onClick={handleRecording} className={classes.avatarRight}
|
|
sx={{backgroundColor:'#ffffff',color: '#6b6b6b', width: 56, height: 56}}
|
|
sx={{backgroundColor:'#ffffff',color: '#6b6b6b', width: 56, height: 56}}
|
|
style={{display: !value && !file && status !== 'stopped' && _status === null&&!isRecording && !isReply && !isForward && !isEdit ? 'block' : 'none'}}/>
|
|
style={{display: !value && !file && status !== 'stopped' && _status === null&&!isRecording && !isReply && !isForward && !isEdit ? 'block' : 'none'}}/>
|