Render disappearing message countdown even if deleted for everyone
This commit is contained in:
parent
c7e7d55af4
commit
6efb6da937
3 changed files with 25 additions and 2 deletions
|
@ -480,6 +480,19 @@ story.add('Deleted', () => {
|
|||
return renderBothDirections(props);
|
||||
});
|
||||
|
||||
story.add('Deleted with expireTimer', () => {
|
||||
const props = createProps({
|
||||
timestamp: Date.now() - 60 * 1000,
|
||||
conversationType: 'group',
|
||||
deletedForEveryone: true,
|
||||
expirationLength: 5 * 60 * 1000,
|
||||
expirationTimestamp: Date.now() + 3 * 60 * 1000,
|
||||
status: 'sent',
|
||||
});
|
||||
|
||||
return renderBothDirections(props);
|
||||
});
|
||||
|
||||
story.add('Can delete for everyone', () => {
|
||||
const props = createProps({
|
||||
status: 'read',
|
||||
|
|
|
@ -587,6 +587,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
const {
|
||||
attachments,
|
||||
collapseMetadata,
|
||||
deletedForEveryone,
|
||||
direction,
|
||||
expirationLength,
|
||||
expirationTimestamp,
|
||||
|
@ -613,6 +614,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
|
||||
return (
|
||||
<MessageMetadata
|
||||
deletedForEveryone={deletedForEveryone}
|
||||
direction={direction}
|
||||
expirationLength={expirationLength}
|
||||
expirationTimestamp={expirationTimestamp}
|
||||
|
@ -2080,7 +2082,12 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
const { isTapToView, deletedForEveryone } = this.props;
|
||||
|
||||
if (deletedForEveryone) {
|
||||
return this.renderText();
|
||||
return (
|
||||
<>
|
||||
{this.renderText()}
|
||||
{this.renderMetadata()}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (isTapToView) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import { Timestamp } from './Timestamp';
|
|||
import { Spinner } from '../Spinner';
|
||||
|
||||
type PropsType = {
|
||||
deletedForEveryone?: boolean;
|
||||
direction: DirectionType;
|
||||
expirationLength?: number;
|
||||
expirationTimestamp?: number;
|
||||
|
@ -28,6 +29,7 @@ type PropsType = {
|
|||
|
||||
export const MessageMetadata: FunctionComponent<PropsType> = props => {
|
||||
const {
|
||||
deletedForEveryone,
|
||||
direction,
|
||||
expirationLength,
|
||||
expirationTimestamp,
|
||||
|
@ -130,7 +132,8 @@ export const MessageMetadata: FunctionComponent<PropsType> = props => {
|
|||
<Spinner svgSize="small" size="14px" direction={direction} />
|
||||
</div>
|
||||
) : null}
|
||||
{!textPending &&
|
||||
{!deletedForEveryone &&
|
||||
!textPending &&
|
||||
direction === 'outgoing' &&
|
||||
status !== 'error' &&
|
||||
status !== 'partial-sent' ? (
|
||||
|
|
Loading…
Add table
Reference in a new issue