mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
@@ -17,9 +17,8 @@ import { fileToBytes } from './fileToBytes';
|
||||
import { handleImageAttachment } from './handleImageAttachment';
|
||||
import { handleVideoAttachment } from './handleVideoAttachment';
|
||||
import { isHeic, stringToMIMEType } from '../types/MIME';
|
||||
import { ToastType } from '../types/Toast';
|
||||
import { isImageTypeSupported, isVideoTypeSupported } from './GoogleChrome';
|
||||
import { showToast } from './showToast';
|
||||
import { ToastFileSize } from '../components/ToastFileSize';
|
||||
|
||||
export async function processAttachment(
|
||||
file: File,
|
||||
@@ -80,7 +79,10 @@ function isAttachmentSizeOkay(attachment: Readonly<AttachmentType>): boolean {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
if ((attachment.data.byteLength / KIBIBYTE).toFixed(4) >= limitKb) {
|
||||
showToast(ToastFileSize, getRenderDetailsForLimit(limitKb));
|
||||
window.reduxActions.toast.showToast({
|
||||
toastType: ToastType.FileSize,
|
||||
parameters: getRenderDetailsForLimit(limitKb),
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user