@@ -81,31 +81,28 @@ export class CoreFileProvider {
8181
8282 this . logger = logger . getInstance ( 'CoreFileProvider' ) ;
8383
84- platform . ready ( ) . then ( ( ) => {
85- if ( appProvider . isAndroid ( ) && ! Object . getOwnPropertyDescriptor ( FileReader . prototype , 'onloadend' ) ) {
86- // Cordova File plugin creates some getters and setter for FileReader, but
87- // Ionic's polyfills override them in Android.
88- // Create the getters and setters again. This code comes from FileReader.js in cordova-plugin-file.
89- this . defineGetterSetter ( FileReader . prototype , 'readyState' , function ( ) : any {
90- return this . _localURL ? this . _readyState : this . _realReader . readyState ;
91- } ) ;
84+ if ( appProvider . isAndroid ( ) && ! Object . getOwnPropertyDescriptor ( FileReader . prototype , 'onloadend' ) ) {
85+ // Cordova File plugin creates some getters and setter for FileReader, but Ionic's polyfills override them in Android.
86+ // Create the getters and setters again. This code comes from FileReader.js in cordova-plugin-file.
87+ this . defineGetterSetter ( FileReader . prototype , 'readyState' , function ( ) : any {
88+ return this . _localURL ? this . _readyState : this . _realReader . readyState ;
89+ } ) ;
9290
93- this . defineGetterSetter ( FileReader . prototype , 'error' , function ( ) : any {
94- return this . _localURL ? this . _error : this . _realReader . error ;
95- } ) ;
91+ this . defineGetterSetter ( FileReader . prototype , 'error' , function ( ) : any {
92+ return this . _localURL ? this . _error : this . _realReader . error ;
93+ } ) ;
9694
97- this . defineGetterSetter ( FileReader . prototype , 'result' , function ( ) : any {
98- return this . _localURL ? this . _result : this . _realReader . result ;
99- } ) ;
95+ this . defineGetterSetter ( FileReader . prototype , 'result' , function ( ) : any {
96+ return this . _localURL ? this . _result : this . _realReader . result ;
97+ } ) ;
10098
101- this . defineEvent ( 'onloadstart' ) ;
102- this . defineEvent ( 'onprogress' ) ;
103- this . defineEvent ( 'onload' ) ;
104- this . defineEvent ( 'onerror' ) ;
105- this . defineEvent ( 'onloadend' ) ;
106- this . defineEvent ( 'onabort' ) ;
107- }
108- } ) ;
99+ this . defineEvent ( 'onloadstart' ) ;
100+ this . defineEvent ( 'onprogress' ) ;
101+ this . defineEvent ( 'onload' ) ;
102+ this . defineEvent ( 'onerror' ) ;
103+ this . defineEvent ( 'onloadend' ) ;
104+ this . defineEvent ( 'onabort' ) ;
105+ }
109106 }
110107
111108 /**
0 commit comments