Skip to content

Commit

Permalink
Update App.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
dmihalcik-virtru committed May 9, 2024
1 parent 739b320 commit 71a9746
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ function App() {
'file' == inputSource.type
? await inputSource.file.arrayBuffer()
: 'memory' == inputSource.type
? inputSource.src
: randomArrayBuffer(inputSource);
? inputSource.src
: randomArrayBuffer(inputSource);
setDownloadState('Encrypting...');
const cipherText = await nanoClient.encrypt(plainText);
switch (sinkType) {
Expand Down Expand Up @@ -587,8 +587,8 @@ function App() {
'file' == inputSource.type
? await inputSource.file.arrayBuffer()
: 'memory' == inputSource.type
? inputSource.src
: randomArrayBuffer(inputSource);
? inputSource.src
: randomArrayBuffer(inputSource);
const plainText = await nanoClient.decrypt(cipherText);
switch (sinkType) {
case 'file':
Expand Down Expand Up @@ -675,6 +675,10 @@ function App() {
size = inputSource.length;
source = { type: 'chunker', location: randomChunker(inputSource) };
break;
case 'memory':
size = inputSource.src.byteLength;
source = { type: 'buffer', location: new Uint8Array(inputSource.src) };
break;
case 'url':
const hr = await fetch(inputSource.url, { method: 'HEAD' });
size = parseInt(hr.headers.get('Content-Length') || '-1');
Expand Down

0 comments on commit 71a9746

Please sign in to comment.