File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
apps/frontend/src/components/media Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -88,18 +88,10 @@ export function useUppyUploader(props: {
8888 // Expand generic types to specific ones
8989 const expandedTypes = allowedTypes . flatMap ( ( type ) => {
9090 if ( type === 'image/*' ) {
91- return [
92- 'image/png' ,
93- 'image/jpeg' ,
94- 'image/jpg' ,
95- 'image/gif' ,
96- ] ;
91+ return [ 'image/png' , 'image/jpeg' , 'image/jpg' , 'image/gif' ] ;
9792 }
9893 if ( type === 'video/*' ) {
99- return [
100- 'video/mp4' ,
101- 'video/mpeg' ,
102- ] ;
94+ return [ 'video/mp4' , 'video/mpeg' ] ;
10395 }
10496 return [ type ] ;
10597 } ) ;
@@ -214,12 +206,11 @@ export function useUppyUploader(props: {
214206 return ;
215207 }
216208
217- console . log ( result ) ;
218209 if ( transloadit . length > 0 ) {
219210 // @ts -ignore
220211 const allRes = result . transloadit [ 0 ] . results ;
221212 const toSave = uniq < string > (
222- allRes [ Object . keys ( allRes ) [ 0 ] ] . flatMap ( ( item : any ) =>
213+ ( allRes [ Object . keys ( allRes ) [ 0 ] ] || [ ] ) . flatMap ( ( item : any ) =>
223214 item . url . split ( '/' ) . pop ( )
224215 )
225216 ) ;
You can’t perform that action at this time.
0 commit comments