Skip to content

Commit

Permalink
refactor(image-loader): fix return type conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Apr 18, 2017
1 parent fe986d9 commit 5d4dd98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/image-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ export class ImageLoader {
return this.file
.checkDir(this.file.cacheDirectory, this.config.cacheDirectoryName)
.then(() => {
return (this.isWKWebView ? this.file.checkDir(this.file.tempDirectory, this.config.cacheDirectoryName) : Promise.resolve());
return (this.isWKWebView ? this.file.checkDir(this.file.tempDirectory, this.config.cacheDirectoryName) : Promise.resolve(true));
});
}

Expand All @@ -517,11 +517,11 @@ export class ImageLoader {
* @param replace {boolean} override directory if exists
* @returns {Promise<DirectoryEntry|FileError>} Returns a promise that resolves if the directory was created, and rejects on error
*/
private createCacheDirectory(replace: boolean = false): Promise<any> {
private createCacheDirectory(replace: boolean = false): Promise<DirectoryEntry> {
return this.file
.createDir(this.file.cacheDirectory, this.config.cacheDirectoryName, replace)
.then(() => {
return this.isWKWebView ? this.file.createDir(this.file.tempDirectory, this.config.cacheDirectoryName, replace) : Promise.resolve();
.then((res: DirectoryEntry) => {
return this.isWKWebView ? this.file.createDir(this.file.tempDirectory, this.config.cacheDirectoryName, replace) : Promise.resolve(res);
});
}

Expand Down

0 comments on commit 5d4dd98

Please sign in to comment.