File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -361,8 +361,8 @@ function App() {
361
361
'file' == inputSource . type
362
362
? await inputSource . file . arrayBuffer ( )
363
363
: 'memory' == inputSource . type
364
- ? inputSource . src
365
- : randomArrayBuffer ( inputSource ) ;
364
+ ? inputSource . src
365
+ : randomArrayBuffer ( inputSource ) ;
366
366
setDownloadState ( 'Encrypting...' ) ;
367
367
const cipherText = await nanoClient . encrypt ( plainText ) ;
368
368
switch ( sinkType ) {
@@ -587,8 +587,8 @@ function App() {
587
587
'file' == inputSource . type
588
588
? await inputSource . file . arrayBuffer ( )
589
589
: 'memory' == inputSource . type
590
- ? inputSource . src
591
- : randomArrayBuffer ( inputSource ) ;
590
+ ? inputSource . src
591
+ : randomArrayBuffer ( inputSource ) ;
592
592
const plainText = await nanoClient . decrypt ( cipherText ) ;
593
593
switch ( sinkType ) {
594
594
case 'file' :
@@ -675,6 +675,10 @@ function App() {
675
675
size = inputSource . length ;
676
676
source = { type : 'chunker' , location : randomChunker ( inputSource ) } ;
677
677
break ;
678
+ case 'memory' :
679
+ size = inputSource . src . byteLength ;
680
+ source = { type : 'buffer' , location : new Uint8Array ( inputSource . src ) } ;
681
+ break ;
678
682
case 'url' :
679
683
const hr = await fetch ( inputSource . url , { method : 'HEAD' } ) ;
680
684
size = parseInt ( hr . headers . get ( 'Content-Length' ) || '-1' ) ;
You can’t perform that action at this time.
0 commit comments