Moves DraftAttachments into redux

This commit is contained in:
Josh Perez 2021-09-24 16:02:30 -04:00 committed by Josh Perez
parent f81f61af4e
commit 1c3c971cf4
20 changed files with 818 additions and 444 deletions

View file

@ -55,6 +55,7 @@ export type AttachmentType = {
contentType: MIME.MIMEType;
path: string;
};
screenshotData?: Uint8Array;
screenshotPath?: string;
flags?: number;
thumbnail?: ThumbnailType;
@ -96,19 +97,6 @@ export type InMemoryAttachmentDraftType =
pending: true;
};
export type OnDiskAttachmentDraftType =
| ({
caption?: string;
pending: false;
screenshotPath?: string;
} & BaseAttachmentDraftType)
| {
contentType: MIME.MIMEType;
fileName: string;
path: string;
pending: true;
};
export type AttachmentDraftType =
| ({
url: string;

View file

@ -0,0 +1,11 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export enum AttachmentToastType {
ToastCannotMixImageAndNonImageAttachments,
ToastDangerousFileType,
ToastFileSize,
ToastMaxAttachments,
ToastOneNonImageAtATime,
ToastUnableToLoadAttachment,
}