shouldCurrentMessageHideMetadata: Hide more often for less jumpiness

This commit is contained in:
Scott Nonnenberg 2022-03-30 20:07:14 -07:00 committed by GitHub
parent 16f0f4262a
commit 97b03d8803
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View file

@ -217,7 +217,7 @@ describe('<Timeline> utilities', () => {
assert.isTrue(shouldCurrentMessageHideMetadata(true, current, newer));
});
it('returns true if all three have delivered status or above', () => {
it('returns true if both have delivered status or above', () => {
assert.isTrue(
shouldCurrentMessageHideMetadata(true, defaultCurrent, defaultNewer)
);

View file

@ -88,18 +88,13 @@ export function shouldCurrentMessageHideMetadata(
case 'sending':
return false;
case 'sent':
return newerMessage.status === 'sent';
case 'delivered':
case 'read':
case 'viewed':
return (
newerMessage.status === 'delivered' ||
newerMessage.status === 'read' ||
newerMessage.status === 'viewed'
);
return true;
default:
log.error(missingCaseError(message.status));
return false;
return true;
}
}