Merge pull request #3 from Ninja3047/master

fix typescript errors, add tsconfig.json
This commit is contained in:
Ninja3047 2022-07-27 22:08:59 -04:00 committed by GitHub
commit 7b7d119831
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,15 +25,13 @@ require('highlightjs-line-numbers.js');
const FileForm = () => { const FileForm = () => {
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => { const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
let file = event.target.files![0];
const fr = new FileReader(); const fr = new FileReader();
fr.onload = (e) => { fr.onload = (_e) => {
const { result } = e.target; let data = new Uint8Array(fr.result as ArrayBuffer);
if (result instanceof ArrayBuffer) {
let data = new Uint8Array(result);
encrypt_array_buffer(data); encrypt_array_buffer(data);
} }
} fr.readAsArrayBuffer(file);
fr.readAsArrayBuffer((event.target as HTMLInputElement).files[0]);
} }
return ( return (