[Fix] Invalid URL error and image caching #1210
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
URLs were being passed over file protocol like
https//gateway.valist.io/ipfs/bafybeig57jh3x3q2vlmctjsdkx6yx36n4uza2rsp373suwlzcs2bgxkpbe
without the colon.This was causing axios to throw a
Invalid URL
unhandled error on everyCachedImage
component render. This also broke the image caching functionality atimagesCachePath
.See Heroic-Games-Launcher/HeroicGamesLauncher#1732 for more context on the original implementation.
We may be able to use https://www.electronjs.org/docs/latest/api/command-line-switches#--disk-cache-sizesize, which was suggested here electron/electron#7713, for the same use case in the future as well instead of a custom caching implementation.
Closes https://github.com/HyperPlay-Gaming/product-management/issues/866