Allow stage and send of video, even if we can't get screenshot
This commit is contained in:
parent
117cb074c7
commit
a024ee4b96
21 changed files with 224 additions and 143 deletions
|
@ -78,40 +78,46 @@ export type DownloadedAttachmentType = AttachmentType & {
|
|||
export type BaseAttachmentDraftType = {
|
||||
blurHash?: string;
|
||||
contentType: MIME.MIMEType;
|
||||
fileName: string;
|
||||
path: string;
|
||||
screenshotContentType?: string;
|
||||
screenshotSize?: number;
|
||||
size: number;
|
||||
flags?: number;
|
||||
};
|
||||
|
||||
// An ephemeral attachment type, used between user's request to add the attachment as
|
||||
// a draft and final save on disk and in conversation.draftAttachments.
|
||||
export type InMemoryAttachmentDraftType =
|
||||
| ({
|
||||
data?: Uint8Array;
|
||||
data: Uint8Array;
|
||||
pending: false;
|
||||
screenshotData?: Uint8Array;
|
||||
fileName?: string;
|
||||
path?: string;
|
||||
} & BaseAttachmentDraftType)
|
||||
| {
|
||||
contentType: MIME.MIMEType;
|
||||
fileName: string;
|
||||
path: string;
|
||||
fileName?: string;
|
||||
path?: string;
|
||||
pending: true;
|
||||
size: number;
|
||||
};
|
||||
|
||||
// What's stored in conversation.draftAttachments
|
||||
export type AttachmentDraftType =
|
||||
| ({
|
||||
url: string;
|
||||
url?: string;
|
||||
screenshotPath?: string;
|
||||
pending: false;
|
||||
// Old draft attachments may have a caption, though they are no longer editable
|
||||
// because we removed the caption editor.
|
||||
caption?: string;
|
||||
fileName?: string;
|
||||
path: string;
|
||||
} & BaseAttachmentDraftType)
|
||||
| {
|
||||
contentType: MIME.MIMEType;
|
||||
fileName: string;
|
||||
path: string;
|
||||
fileName?: string;
|
||||
path?: string;
|
||||
pending: true;
|
||||
size: number;
|
||||
};
|
||||
|
@ -614,6 +620,10 @@ export function getUrl(attachment: AttachmentType): string | undefined {
|
|||
return attachment.screenshot.url;
|
||||
}
|
||||
|
||||
if (isVideoAttachment(attachment)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return attachment.url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue