Mark attachment as corrupted if audio load failed
Sending corrupted audio should not leave user with non-functional UI. Mark attachment as corrupted and show generic attachment UI for it instead.
This commit is contained in:
parent
d6063d71e5
commit
9fa3359477
12 changed files with 98 additions and 5 deletions
|
@ -49,6 +49,7 @@ export type AttachmentType = {
|
|||
contentType: MIME.MIMEType;
|
||||
path: string;
|
||||
};
|
||||
isCorrupted?: boolean;
|
||||
};
|
||||
|
||||
// UI-focused functions
|
||||
|
@ -87,6 +88,7 @@ export function isAudio(
|
|||
attachments &&
|
||||
attachments[0] &&
|
||||
attachments[0].contentType &&
|
||||
!attachments[0].isCorrupted &&
|
||||
MIME.isAudio(attachments[0].contentType)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue