@@ -96,9 +96,7 @@ function quickUploadStore (state, emitter) {
96
96
}
97
97
progressHandler ( 0 , totalSize , state , emitter )
98
98
emitter . emit ( 'render' )
99
- // TODO: update flag below after wrapping support is released with new js-ipfs
100
- // TODO: also enable multiple file selection in <input type=file> (blocked for js-ipfs for now)
101
- const wrapFlag = ( state . wrapWithDirectory || files . length > 1 ) && state . ipfsNodeType !== 'embedded'
99
+ const wrapFlag = ( state . wrapWithDirectory || files . length > 1 )
102
100
const uploadOptions = {
103
101
progress : ( len ) => progressHandler ( len , totalSize , state , emitter ) ,
104
102
wrapWithDirectory : wrapFlag ,
@@ -123,6 +121,7 @@ function quickUploadOptions (state, emit) {
123
121
const onExpandOptions = ( e ) => { state . expandOptions = true ; emit ( 'render' ) }
124
122
const onWrapWithDirectoryChange = ( e ) => { state . wrapWithDirectory = e . target . checked }
125
123
const onPinUploadChange = ( e ) => { state . pinUpload = e . target . checked }
124
+ const isPinningSupported = state . ipfsNodeType === 'external'
126
125
if ( state . expandOptions ) {
127
126
return html `
128
127
< div id ='quickUploadOptions ' class ='sans-serif mt3 f6 lh-copy light-gray no-user-select '>
@@ -131,11 +130,13 @@ function quickUploadOptions (state, emit) {
131
130
< span class ='mark db flex items-center relative mr2 br2 '> </ span >
132
131
${ browser . i18n . getMessage ( 'quickUpload_options_wrapWithDirectory' ) }
133
132
</ label >
133
+ ${ isPinningSupported ? ( html `
134
134
< label for ='pinUpload ' class ='flex items-center db relative mt1 pointer '>
135
135
< input id ='pinUpload ' type ='checkbox ' onchange =${ onPinUploadChange } checked =${ state . pinUpload } />
136
136
< span class ='mark db flex items-center relative mr2 br2 '> </ span >
137
137
${ browser . i18n . getMessage ( 'quickUpload_options_pinUpload' ) }
138
- </ label >
138
+ </ label > ` )
139
+ : null }
139
140
</ div >
140
141
`
141
142
}
@@ -169,7 +170,7 @@ function quickUploadPage (state, emit) {
169
170
</ div >
170
171
</ header >
171
172
< label for ="quickUploadInput " class ='db relative mt5 hover-inner-shadow ' style ="border:solid 2px #6ACAD1 ">
172
- < input class ="db pointer w-100 h-100 top-0 o-0 " type ="file " id ="quickUploadInput " ${ state . ipfsNodeType === 'external' ? ' multiple' : null } onchange =${ onFileInputChange } / >
173
+ < input class ="db pointer w-100 h-100 top-0 o-0 " type ="file " id ="quickUploadInput " multiple onchange =${ onFileInputChange } / >
173
174
< div class ='dt dim ' style ='padding-left: 100px; height: 300px '>
174
175
< div class ='dtc v-mid '>
175
176
< span class ="f3 link dim br1 ph4 pv3 dib white " style ="background: #6ACAD1 ">
@@ -185,8 +186,7 @@ function quickUploadPage (state, emit) {
185
186
</ div >
186
187
</ div >
187
188
</ label >
188
- <!-- TODO: enable wrapping in embedded node after js-ipfs release -->
189
- ${ state . ipfsNodeType === 'external' ? quickUploadOptions ( state , emit ) : null }
189
+ ${ quickUploadOptions ( state , emit ) }
190
190
</ div >
191
191
</ div >
192
192
`
0 commit comments