1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
metamask-extension/ui/app/helpers/utils
Mark Stacey 3e9d247d4b
Fix fetch-with-cache (#7083)
The `fetch-with-cache` utility was failing to actually cache anything.
It would cache an object with cache time and URL, and would return that
instead of a valid response. This resulted in the error:
`TypeError: fourByteResponse.json is not a function`

The utility was updated to call `.json()` within itself, and cache the
JSON response. The function signature was updated as well, to expect an
options object instead of just the `cacheRefreshTime` option. The
timeout was added to this options object, which helped with testing.

The utility method now also handles unsuccessfull responses, and
incompatible `fetch` options.
2019-09-04 16:10:23 -03:00
..
common.util.js
common.util.test.js
confirm-tx.util.js
confirm-tx.util.test.js
conversion-util.js
conversion-util.test.js
conversions.util.js
fetch-with-cache.js Fix fetch-with-cache (#7083) 2019-09-04 16:10:23 -03:00
fetch-with-cache.test.js Fix fetch-with-cache (#7083) 2019-09-04 16:10:23 -03:00
fetch.js
fetch.test.js
formatters.js
i18n-helper.js
metametrics.util.js
switch-direction.js Right-to-left CSS (using module for conversion) (#7072) 2019-09-03 14:47:54 -03:00
token-util.js
transactions.util.js Fix fetch-with-cache (#7083) 2019-09-04 16:10:23 -03:00
transactions.util.test.js
util.js