Allow forward of image attachment with no text
This commit is contained in:
parent
a76534ed45
commit
d91a4ef3a6
1 changed files with 10 additions and 9 deletions
|
@ -118,8 +118,16 @@ export const ForwardMessageModal: FunctionComponent<PropsType> = ({
|
||||||
[inputApiRef, onPickEmoji]
|
[inputApiRef, onPickEmoji]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const hasContactsSelected = Boolean(selectedContacts.length);
|
||||||
|
|
||||||
|
const canForwardMessage =
|
||||||
|
hasContactsSelected &&
|
||||||
|
(Boolean(messageBodyText) ||
|
||||||
|
isSticker ||
|
||||||
|
(attachmentsToForward && attachmentsToForward.length));
|
||||||
|
|
||||||
const forwardMessage = React.useCallback(() => {
|
const forwardMessage = React.useCallback(() => {
|
||||||
if (!messageBodyText) {
|
if (!canForwardMessage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,20 +139,13 @@ export const ForwardMessageModal: FunctionComponent<PropsType> = ({
|
||||||
);
|
);
|
||||||
}, [
|
}, [
|
||||||
attachmentsToForward,
|
attachmentsToForward,
|
||||||
|
canForwardMessage,
|
||||||
doForwardMessage,
|
doForwardMessage,
|
||||||
linkPreview,
|
linkPreview,
|
||||||
messageBodyText,
|
messageBodyText,
|
||||||
selectedContacts,
|
selectedContacts,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const hasContactsSelected = Boolean(selectedContacts.length);
|
|
||||||
|
|
||||||
const canForwardMessage =
|
|
||||||
hasContactsSelected &&
|
|
||||||
(Boolean(messageBodyText) ||
|
|
||||||
isSticker ||
|
|
||||||
(attachmentsToForward && attachmentsToForward.length));
|
|
||||||
|
|
||||||
const normalizedSearchTerm = searchTerm.trim();
|
const normalizedSearchTerm = searchTerm.trim();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue