Skip to content

Commit 71a9746

Browse files
Update App.tsx
1 parent 739b320 commit 71a9746

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

web-app/src/App.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ function App() {
361361
'file' == inputSource.type
362362
? await inputSource.file.arrayBuffer()
363363
: 'memory' == inputSource.type
364-
? inputSource.src
365-
: randomArrayBuffer(inputSource);
364+
? inputSource.src
365+
: randomArrayBuffer(inputSource);
366366
setDownloadState('Encrypting...');
367367
const cipherText = await nanoClient.encrypt(plainText);
368368
switch (sinkType) {
@@ -587,8 +587,8 @@ function App() {
587587
'file' == inputSource.type
588588
? await inputSource.file.arrayBuffer()
589589
: 'memory' == inputSource.type
590-
? inputSource.src
591-
: randomArrayBuffer(inputSource);
590+
? inputSource.src
591+
: randomArrayBuffer(inputSource);
592592
const plainText = await nanoClient.decrypt(cipherText);
593593
switch (sinkType) {
594594
case 'file':
@@ -675,6 +675,10 @@ function App() {
675675
size = inputSource.length;
676676
source = { type: 'chunker', location: randomChunker(inputSource) };
677677
break;
678+
case 'memory':
679+
size = inputSource.src.byteLength;
680+
source = { type: 'buffer', location: new Uint8Array(inputSource.src) };
681+
break;
678682
case 'url':
679683
const hr = await fetch(inputSource.url, { method: 'HEAD' });
680684
size = parseInt(hr.headers.get('Content-Length') || '-1');

0 commit comments

Comments
 (0)