ConversationView: Move attachments processing into redux

This commit is contained in:
Scott Nonnenberg 2022-12-07 17:26:59 -08:00 committed by GitHub
parent ff6750e4fd
commit 452e0b7b31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 544 additions and 763 deletions

View file

@ -42,6 +42,14 @@ export function ToastManager({
);
}
if (toastType === ToastType.CannotMixMultiAndNonMultiAttachments) {
return (
<Toast onClose={hideToast}>
{i18n('cannotSelectPhotosAndVideosAlongWithFiles')}
</Toast>
);
}
if (toastType === ToastType.CannotStartGroupCall) {
return (
<Toast onClose={hideToast}>
@ -66,6 +74,10 @@ export function ToastManager({
);
}
if (toastType === ToastType.DangerousFileType) {
return <Toast onClose={hideToast}>{i18n('dangerousFileType')}</Toast>;
}
if (toastType === ToastType.DeleteForEveryoneFailed) {
return <Toast onClose={hideToast}>{i18n('deleteForEveryoneFailed')}</Toast>;
}
@ -93,6 +105,18 @@ export function ToastManager({
);
}
if (toastType === ToastType.FileSize) {
return (
<Toast onClose={hideToast}>
{i18n('icu:fileSizeWarning', toast?.parameters)}
</Toast>
);
}
if (toastType === ToastType.MaxAttachments) {
return <Toast onClose={hideToast}>{i18n('maximumAttachments')}</Toast>;
}
if (toastType === ToastType.MessageBodyTooLong) {
return <ToastMessageBodyTooLong i18n={i18n} onClose={hideToast} />;
}
@ -157,6 +181,18 @@ export function ToastManager({
);
}
if (toastType === ToastType.UnableToLoadAttachment) {
return <Toast onClose={hideToast}>{i18n('unableToLoadAttachment')}</Toast>;
}
if (toastType === ToastType.UnsupportedMultiAttachment) {
return (
<Toast onClose={hideToast}>
{i18n('cannotSelectPhotosAndVideosAlongWithFiles')}
</Toast>
);
}
if (toastType === ToastType.UserAddedToGroup) {
return (
<Toast onClose={hideToast}>