Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preloaded images not being recognised #207

Open
michaeljcoyne opened this issue Apr 4, 2017 · 0 comments
Open

Preloaded images not being recognised #207

michaeljcoyne opened this issue Apr 4, 2017 · 0 comments

Comments

@michaeljcoyne
Copy link

michaeljcoyne commented Apr 4, 2017

In my app component (Ionic) I initialize imagecache. I then loop through the images on a remote server to preload them. I can see them being downloaded into the imagecache folder.

I then use the following code:

ImgCache.isCached(that.src, (path: string, success: boolean) => {

          if (success) {
              alert('caching ' + that.src);
              ImgCache.useCachedFile(that.img, function () {
                  alert('now using local copy ' + that.src);
              }, function () {
                  alert('could not load from cache' + that.src);
              })

          } else {
              alert('no cache ' + that.src)
              ImgCache.useOnlineFile(that.img);
              ImgCache.cacheFile(that.src, () => {});
          }

      });

This doesn't work the first time. It is not recognizing the previously downloaded file. Why is this? Is it naming them differently or something? Is there a way to force the reference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant