Repair broken attachments with non-array 'data' fields

This commit is contained in:
Scott Nonnenberg 2022-07-18 13:01:43 -07:00 committed by GitHub
parent a0424be5bb
commit 2f252b8e26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 105 additions and 34 deletions

View file

@ -93,6 +93,9 @@ import * as log from '../../logging/log';
import { getConversationColorAttributes } from '../../util/getConversationColorAttributes';
import { DAY, HOUR } from '../../util/durations';
import { getStoryReplyText } from '../../util/getStoryReplyText';
import { isIncoming, isOutgoing, isStory } from '../../messages/helpers';
export { isIncoming, isOutgoing, isStory };
const THREE_HOURS = 3 * HOUR;
const linkify = LinkifyIt();
@ -129,24 +132,6 @@ export type GetPropsForBubbleOptions = Readonly<{
contactNameColorSelector: ContactNameColorSelectorType;
}>;
export function isIncoming(
message: Pick<MessageWithUIFieldsType, 'type'>
): boolean {
return message.type === 'incoming';
}
export function isOutgoing(
message: Pick<MessageWithUIFieldsType, 'type'>
): boolean {
return message.type === 'outgoing';
}
export function isStory(
message: Pick<MessageWithUIFieldsType, 'type'>
): boolean {
return message.type === 'story';
}
export function hasErrors(
message: Pick<MessageWithUIFieldsType, 'errors'>
): boolean {