File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -787,7 +787,17 @@ class PickerLoader {
787787 const validateRes = getValidator ( PickerParamsSchema ) ( options ) ;
788788
789789 if ( validateRes . errors . length ) {
790- throw new FilestackError ( `Invalid picker params` , validateRes . errors , FilestackErrorType . VALIDATION ) ;
790+ validateRes . errors . forEach ( error => {
791+ if ( error . path . includes ( 'fromSources' ) ) {
792+ console . warn ( `Warning: Invalid source \"${ error . instance } \" found and removed!` ) ;
793+ options . fromSources = options . fromSources . filter ( source => source !== error . instance ) ;
794+ } else {
795+ throw new FilestackError ( `Invalid picker params` , validateRes . errors , FilestackErrorType . VALIDATION ) ;
796+ }
797+ } ) ;
798+ if ( ! options . fromSources . length ) {
799+ delete options . fromSources ;
800+ }
791801 }
792802
793803 this . _initialized = this . loadModule ( client , options ) ;
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export const PickerParamsSchema = {
6868 'facebook' ,
6969 'instagram' ,
7070 'googledrive' ,
71+ 'picasa' ,
7172 'unsplash' ,
7273 'dropbox' ,
7374 'webcam' ,
You can’t perform that action at this time.
0 commit comments