don't use cache for theme data

This commit is contained in:
Henry Jameson 2020-02-11 10:42:15 +02:00
parent 786a695eb6
commit 29133fb008

View File

@ -313,7 +313,9 @@ export const generatePreset = (input) => {
} }
export const getThemes = () => { export const getThemes = () => {
return window.fetch('/static/styles.json') const cache = 'no-store'
return window.fetch('/static/styles.json', { cache })
.then((data) => data.json()) .then((data) => data.json())
.then((themes) => { .then((themes) => {
return Object.entries(themes).map(([k, v]) => { return Object.entries(themes).map(([k, v]) => {
@ -321,7 +323,7 @@ export const getThemes = () => {
if (typeof v === 'object') { if (typeof v === 'object') {
promise = Promise.resolve(v) promise = Promise.resolve(v)
} else if (typeof v === 'string') { } else if (typeof v === 'string') {
promise = window.fetch(v) promise = window.fetch(v, { cache })
.then((data) => data.json()) .then((data) => data.json())
.catch((e) => { .catch((e) => {
console.error(e) console.error(e)