Only show download button if message has attachments to download
This commit is contained in:
parent
86026bd66a
commit
12a9ecfd35
2 changed files with 11 additions and 16 deletions
|
@ -2068,15 +2068,19 @@ export function canDownload(
|
|||
message: MessageWithUIFieldsType,
|
||||
conversationSelector: GetConversationByIdType
|
||||
): boolean {
|
||||
if (isOutgoing(message)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const conversation = getConversation(message, conversationSelector);
|
||||
const isAccepted = Boolean(
|
||||
conversation && conversation.acceptedMessageRequest
|
||||
);
|
||||
if (!isAccepted) {
|
||||
if (isIncoming(message) && !isAccepted) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (message.sticker) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isTapToView(message)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2086,7 +2090,7 @@ export function canDownload(
|
|||
return attachments.every(attachment => Boolean(attachment.path));
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
export function getLastChallengeError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue