Hide "delete for everyone" button for pending messages

This commit is contained in:
Evan Hahn 2021-12-02 15:28:19 -06:00 committed by GitHub
parent ee8d0196b1
commit c88cb62464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 44 deletions

View file

@ -1493,11 +1493,8 @@ export function canDeleteForEveryone(
!message.deletedForEveryone &&
// Is it too old to delete?
isMoreRecentThan(message.sent_at, THREE_HOURS) &&
// Is it pending/sent to anyone?
someSendStatus(
message.sendStateByConversationId,
sendStatus => sendStatus !== SendStatus.Failed
)
// Is it sent to anyone?
someSendStatus(message.sendStateByConversationId, isSent)
);
}