| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,7 +73,7 @@ export class Cache extends common.Cache { | |||
| 73 | 73 | super(); | |
| 74 | 74 | ||
| 75 | 75 | this._cache = new NSCache<any, any>(); | |
| 76 | - | ||
| 76 | + | ||
| 77 | 77 | //this._delegate = NSCacheDelegateImpl.new(); | |
| 78 | 78 | //this._cache.delegate = this._delegate; | |
| 79 | 79 | ||
@@ -83,20 +83,16 @@ export class Cache extends common.Cache { | |||
| 83 | 83 | public _downloadCore(request: common.DownloadRequest) { | |
| 84 | 84 | ensureHttpRequest(); | |
| 85 | 85 | ||
| 86 | - var that = this; | ||
| 87 | 86 | httpRequest.request({ url: request.url, method: "GET" }) | |
| 88 | - .then(response => { | ||
| 89 | - try { | ||
| 90 | - var image = UIImage.alloc().initWithData(response.content.raw); | ||
| 91 | - that._onDownloadCompleted(request.key, image); | ||
| 92 | - } catch (err) { | ||
| 93 | - that._onDownloadError(request.key); | ||
| 94 | - } | ||
| 95 | - }, function(err) { | ||
| 96 | - that._onDownloadError(request.key); | ||
| 97 | - if (trace.isEnabled()) { | ||
| 98 | - trace.write("request error: " + err, trace.categories.Debug); | ||
| 99 | - } | ||
| 87 | + .then((response) => { | ||
| 88 | + try { | ||
| 89 | + var image = UIImage.alloc().initWithData(response.content.raw); | ||
| 90 | + this._onDownloadCompleted(request.key, image); | ||
| 91 | + } catch (err) { | ||
| 92 | + this._onDownloadError(request.key, err); | ||
| 93 | + } | ||
| 94 | + }, (err) => { | ||
| 95 | + this._onDownloadError(request.key, err); | ||
| 100 | 96 | }); | |
| 101 | 97 | } | |
| 102 | 98 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments