Skip to content

Commit

Permalink
fix(image-loader): delete one file at once to maintain cache size
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Mar 22, 2017
1 parent 09871bd commit f37f1e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/image-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ export class ImageLoader {
// grab the first item in index since it's the oldest one
const file: IndexItem = this.cacheIndex.splice(0,1)[0];

if (typeof file == 'undefined') return maintain();

// delete the file then process next file if necessary
this.file.removeFile(this.file.cacheDirectory + this.config.cacheDirectoryName, file.name)
.then(() => next())
Expand Down

0 comments on commit f37f1e9

Please sign in to comment.