fix: show deleted message when outgoing too

pull/3281/head
Audric Ackermann 4 months ago
parent 5c610824a1
commit d8bc48938b
No known key found for this signature in database

@ -342,4 +342,8 @@ input {
.module-message__text {
white-space: pre-wrap;
svg {
margin-right: var(--margins-xs);
}
}

@ -65,9 +65,6 @@
flex-direction: row;
align-items: center;
svg {
margin-right: var(--margins-xs);
}
a {
text-decoration: underline;

@ -10,6 +10,7 @@ import {
} from '../../../../state/selectors/conversations';
import { SessionIcon } from '../../../icon';
import { MessageBody } from './MessageBody';
import { useMessageDirection } from '../../../../state/selectors';
type Props = {
messageId: string;
@ -23,6 +24,7 @@ export type MessageTextSelectorProps = Pick<
export const MessageText = (props: Props) => {
const selected = useSelector((state: StateType) => getMessageTextProps(state, props.messageId));
const multiSelectMode = useSelector(isMessageSelectionMode);
const direction = useMessageDirection(props.messageId);
if (!selected) {
return null;
@ -35,9 +37,14 @@ export const MessageText = (props: Props) => {
return null;
}
const iconColor =
direction === 'incoming'
? 'var(--message-bubbles-received-text-color)'
: 'var(--message-bubbles-sent-text-color)';
return (
<div dir="auto" className={classNames('module-message__text')}>
{isDeleted && <SessionIcon iconType="delete" iconSize="small" />}
{isDeleted && <SessionIcon iconType="delete" iconSize="small" iconColor={iconColor} />}
<MessageBody
text={contents || ''}
disableLinks={multiSelectMode}

@ -1,7 +1,4 @@
import { useSelector } from 'react-redux';
import { v4 as uuidv4 } from 'uuid';
import { StateType } from '../../../../state/reducer';
import { getGenericReadableMessageSelectorProps } from '../../../../state/selectors/conversations';
import { THUMBNAIL_SIDE } from '../../../../types/attachments/VisualAttachment';
import { GenericReadableMessage } from './GenericReadableMessage';
@ -13,15 +10,7 @@ type Props = {
};
export const Message = (props: Props) => {
const msgProps = useSelector((state: StateType) =>
getGenericReadableMessageSelectorProps(state, props.messageId)
);
const ctxMenuID = `ctx-menu-message-${uuidv4()}`;
if (msgProps?.isDeleted && msgProps.direction === 'outgoing') {
return null;
}
return <GenericReadableMessage ctxMenuID={ctxMenuID} messageId={props.messageId} />;
};

Loading…
Cancel
Save