Username Education
Co-authored-by: Jamie Kyle <jamie@signal.org>
This commit is contained in:
parent
c6a7637513
commit
7dc11c1928
100 changed files with 1443 additions and 1269 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue