@@ -22,10 +22,11 @@ export const testConnection = (): Promise<any> => {
2222
2323/**
2424 * Initialize drag and drop.
25+ * @param initCall - Indicate if called via init flow and should not reject
2526 *
2627 * @returns a promise that resolves if the initialization was successful or not
2728 */
28- export const initDragDrop = ( ) : Promise < boolean > => {
29+ export const initDragDrop = ( initCall ?: boolean ) : Promise < boolean > => {
2930 if ( ! asperaSdk . isReady ) {
3031 return throwError ( messages . serverNotVerified ) ;
3132 }
@@ -36,7 +37,13 @@ export const initDragDrop = (): Promise<boolean> => {
3637 . then ( ( data : boolean ) => promiseInfo . resolver ( data ) )
3738 . catch ( error => {
3839 errorLog ( messages . dragDropInitFailed , error ) ;
39- promiseInfo . rejecter ( generateErrorBody ( messages . dragDropInitFailed , error ) ) ;
40+
41+ if ( initCall ) {
42+ promiseInfo . resolver ( false ) ;
43+ errorLog ( messages . dragDropInitFailedInit , error ) ;
44+ } else {
45+ promiseInfo . rejecter ( generateErrorBody ( messages . dragDropInitFailed , error ) ) ;
46+ }
4047 } ) ;
4148
4249 return promiseInfo . promise ;
@@ -73,7 +80,7 @@ export const init = (options?: InitOptions): Promise<any> => {
7380
7481 return asperaSdk . activityTracking . setup ( )
7582 . then ( ( ) => testConnection ( ) )
76- . then ( ( ) => initDragDrop ( ) )
83+ . then ( ( ) => initDragDrop ( true ) )
7784 . catch ( error => {
7885 errorLog ( messages . serverError , error ) ;
7986 asperaSdk . globals . asperaAppVerified = false ;
0 commit comments