File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
services/static-webserver/client/source/class/osparc/utils Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -850,24 +850,25 @@ qx.Class.define("osparc.utils.Utils", {
850850 }
851851 } ) ;
852852 xhr . addEventListener ( "progress" , e => {
853- if ( xhr . readyState === XMLHttpRequest . LOADING ) {
854- if ( xhr . status === 0 || ( xhr . status >= 200 && xhr . status < 400 ) ) {
855- if ( e [ "type" ] === "progress" && progressCb ) {
856- progressCb ( e . loaded / e . total ) ;
857- }
858- }
853+ if (
854+ progressCb &&
855+ xhr . readyState === XMLHttpRequest . LOADING &&
856+ ( xhr . status === 0 || ( xhr . status >= 200 && xhr . status < 400 ) ) &&
857+ e [ "type" ] === "progress"
858+ ) {
859+ progressCb ( e . loaded / e . total ) ;
859860 }
860861 } ) ;
861862 xhr . addEventListener ( "load" , ( ) => {
862863 if ( xhr . status == 200 ) {
863- if ( loadedCb ) {
864- loadedCb ( ) ;
865- }
866864 const blob = new Blob ( [ xhr . response ] ) ;
867865 if ( ! fileName ) {
868866 fileName = this . self ( ) . filenameFromContentDisposition ( xhr ) ;
869867 }
870868 this . self ( ) . downloadBlobContent ( blob , fileName ) ;
869+ if ( loadedCb ) {
870+ loadedCb ( ) ;
871+ }
871872 resolve ( ) ;
872873 } else {
873874 reject ( xhr ) ;
You can’t perform that action at this time.
0 commit comments