Show expiration timer for incoming messages even if unread
This commit is contained in:
parent
c1682a98cc
commit
f572abf57d
3 changed files with 4 additions and 7 deletions
|
@ -390,7 +390,7 @@ story.add('Will expire but still sending', () => {
|
||||||
const props = createProps({
|
const props = createProps({
|
||||||
status: 'sending',
|
status: 'sending',
|
||||||
expirationLength: 30 * 1000,
|
expirationLength: 30 * 1000,
|
||||||
text: 'For outgoing messages, we show timer immediately. Incoming, we wait until expirationStartTimestamp is present.',
|
text: 'We always show the timer if a message has an expiration length, even if unread or still sending.',
|
||||||
});
|
});
|
||||||
|
|
||||||
return renderBothDirections(props);
|
return renderBothDirections(props);
|
||||||
|
|
|
@ -599,14 +599,11 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
* because it can reduce layout jumpiness.
|
* because it can reduce layout jumpiness.
|
||||||
*/
|
*/
|
||||||
private guessMetadataWidth(): number {
|
private guessMetadataWidth(): number {
|
||||||
const { direction, expirationLength, expirationTimestamp, status } =
|
const { direction, expirationLength, status } = this.props;
|
||||||
this.props;
|
|
||||||
|
|
||||||
let result = GUESS_METADATA_WIDTH_TIMESTAMP_SIZE;
|
let result = GUESS_METADATA_WIDTH_TIMESTAMP_SIZE;
|
||||||
|
|
||||||
const hasExpireTimer = Boolean(
|
const hasExpireTimer = Boolean(expirationLength);
|
||||||
expirationLength && (expirationTimestamp || direction === 'outgoing')
|
|
||||||
);
|
|
||||||
if (hasExpireTimer) {
|
if (hasExpireTimer) {
|
||||||
result += GUESS_METADATA_WIDTH_EXPIRE_TIMER_SIZE;
|
result += GUESS_METADATA_WIDTH_EXPIRE_TIMER_SIZE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,7 +126,7 @@ export const MessageMetadata = ({
|
||||||
const children = (
|
const children = (
|
||||||
<>
|
<>
|
||||||
{timestampNode}
|
{timestampNode}
|
||||||
{expirationLength && (expirationTimestamp || direction === 'outgoing') ? (
|
{expirationLength ? (
|
||||||
<ExpireTimer
|
<ExpireTimer
|
||||||
direction={metadataDirection}
|
direction={metadataDirection}
|
||||||
deletedForEveryone={deletedForEveryone}
|
deletedForEveryone={deletedForEveryone}
|
||||||
|
|
Loading…
Add table
Reference in a new issue