Fix utf-8 decoding

pull/2802/head
shamoon 4 months ago
parent 390b02fa2c
commit a5ec0249f8

@ -12,7 +12,8 @@ export default async function cachedFetch(url, duration) {
return cached;
}
const data = await fetch(url).then((res) => res.json());
// wrapping text in JSON.parse to handle utf-8 issues
const data = JSON.parse(await fetch(url).then((res) => res.text()));
cache.put(url, data, duration * 1000 * 60);
return data;
}

Loading…
Cancel
Save