Improve quoted attachment typings

This commit is contained in:
trevor-signal 2024-05-23 17:06:41 -04:00 committed by GitHub
parent 38226115a4
commit 5f0080a7d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 98 additions and 97 deletions

View file

@ -13,6 +13,7 @@ import type {
LastMessageStatus,
MessageAttributesType,
MessageReactionType,
QuotedAttachmentType,
ShallowChallengeError,
} from '../../model-types.d';
@ -41,7 +42,6 @@ import type {
ChangeType,
} from '../../components/conversation/GroupNotification';
import type { PropsType as ProfileChangeNotificationPropsType } from '../../components/conversation/ProfileChangeNotification';
import type { QuotedAttachmentType } from '../../components/conversation/Quote';
import { getDomain, isCallLink, isStickerPack } from '../../types/LinkPreview';
import type {
@ -1852,9 +1852,7 @@ export function getPropsForAttachment(
};
}
function processQuoteAttachment(
attachment: AttachmentType
): QuotedAttachmentType {
function processQuoteAttachment(attachment: QuotedAttachmentType) {
const { thumbnail } = attachment;
const path =
thumbnail && thumbnail.path && getAttachmentUrlForPath(thumbnail.path);