kfiroo / react-native-cached-image

CachedImage component for react-native
MIT License
940 stars 468 forks source link

deleteUrl seems not working #146

Open ravirupareliya opened 5 years ago

ravirupareliya commented 5 years ago

I am getting same url after updating profile picture. So i tried to use deleteUrl() and then again i am loading image into CachedImage.

Problem here is, it seems deleting url but it is not reflecting at a time. When i restart the application, it is showing new image. But when i am on the screen, it is still showing old image, i have used deleteUrl() and on success i am again doing setState but it is not working.

Blutude commented 5 years ago

@ravirupareliya did you figure out how to solve this?

Blutude commented 5 years ago

@ravirupareliya I think I've figured it out. I had the exact same situation, I would use the same url after updating profile picture. The issue with that is if user A updates his profile picture, how would user B know that? User B would still view user A by the old profile picture saved is user B's device. I am appending an index to the filename from 1-99, and every time a user updates his profile picture, I increment that index.