@@ -80,25 +80,23 @@ export class ImageLoader {
80
80
private fileTransfer : FileTransfer ,
81
81
private platform : Platform
82
82
) {
83
- platform . ready ( ) . then ( ( ) => {
84
- if ( ! platform . is ( 'cordova' ) ) {
85
- // we are running on a browser, or using livereload
86
- // plugin will not function in this case
87
- this . isInit = true ;
88
- this . throwWarning ( 'You are running on a browser or using livereload, IonicImageLoader will not function, falling back to browser loading.' ) ;
89
- } else {
90
- Observable . fromEvent ( document , 'deviceready' ) . first ( ) . subscribe ( res => {
91
- if ( this . nativeAvailable ) {
92
- this . initCache ( ) ;
93
- } else {
94
- // we are running on a browser, or using livereload
95
- // plugin will not function in this case
96
- this . isInit = true ;
97
- this . throwWarning ( 'You are running on a browser or using livereload, IonicImageLoader will not function, falling back to browser loading.' ) ;
98
- }
99
- } )
100
- }
101
- } ) ;
83
+ if ( ! platform . is ( 'cordova' ) ) {
84
+ // we are running on a browser, or using livereload
85
+ // plugin will not function in this case
86
+ this . isInit = true ;
87
+ this . throwWarning ( 'You are running on a browser or using livereload, IonicImageLoader will not function, falling back to browser loading.' ) ;
88
+ } else {
89
+ Observable . fromEvent ( document , 'deviceready' ) . first ( ) . subscribe ( res => {
90
+ if ( this . nativeAvailable ) {
91
+ this . initCache ( ) ;
92
+ } else {
93
+ // we are running on a browser, or using livereload
94
+ // plugin will not function in this case
95
+ this . isInit = true ;
96
+ this . throwWarning ( 'You are running on a browser or using livereload, IonicImageLoader will not function, falling back to browser loading.' ) ;
97
+ }
98
+ } ) ;
99
+ }
102
100
}
103
101
104
102
/**
@@ -357,7 +355,7 @@ export class ImageLoader {
357
355
. then ( files => Promise . all ( files . map ( this . addFileToIndex . bind ( this ) ) ) )
358
356
. then ( ( ) => {
359
357
// Sort items by date. Most recent to oldest.
360
- this . cacheIndex = this . cacheIndex . sort ( ( a : IndexItem , b : IndexItem ) : number => a > b ? - 1 : a < b ? 1 : 0 ) ;
358
+ this . cacheIndex = this . cacheIndex . sort ( ( a : IndexItem , b : IndexItem ) : number => a > b ? - 1 : a < b ? 1 : 0 ) ;
361
359
this . indexed = true ;
362
360
return Promise . resolve ( ) ;
363
361
} )
0 commit comments