Fixes link preview send in stories
This commit is contained in:
parent
2637df0c42
commit
e334490cf4
1 changed files with 1 additions and 16 deletions
|
@ -29,20 +29,6 @@ import { collect } from './iterables';
|
|||
import { DurationInSeconds } from './durations';
|
||||
import { sanitizeLinkPreview } from '../services/LinkPreview';
|
||||
|
||||
function cleanLinkPreviewIfAny(attachment: AttachmentType): AttachmentType {
|
||||
if (!attachment.textAttachment || !attachment.textAttachment.preview) {
|
||||
return attachment;
|
||||
}
|
||||
|
||||
return {
|
||||
...attachment,
|
||||
textAttachment: {
|
||||
...attachment.textAttachment,
|
||||
preview: undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export async function sendStoryMessage(
|
||||
listIds: Array<string>,
|
||||
conversationIds: Array<string>,
|
||||
|
@ -153,8 +139,7 @@ export async function sendStoryMessage(
|
|||
sendStateByListId.set(distributionList.id, sendStateByConversationId);
|
||||
});
|
||||
|
||||
const cleanedAttachment = cleanLinkPreviewIfAny(attachment);
|
||||
const attachments: Array<AttachmentType> = [cleanedAttachment];
|
||||
const attachments: Array<AttachmentType> = [attachment];
|
||||
|
||||
const linkPreview = attachment?.textAttachment?.preview;
|
||||
const sanitizedLinkPreview = linkPreview
|
||||
|
|
Loading…
Add table
Reference in a new issue