make USE_CATEGORIES optional

This commit is contained in:
Lachlan Kermode
2020-06-08 16:17:12 +02:00
parent 16358f5ab9
commit c473e4a998
6 changed files with 28 additions and 12 deletions

View File

@@ -31,9 +31,12 @@ export function fetchDomain () {
.then(response => response.json())
.catch(() => handleError('events'))
const catPromise = fetch(CATEGORY_URL)
.then(response => response.json())
.catch(() => handleError(domainMsg('categories')))
let catPromise = Promise.resolve([])
if (features.USE_CATEGORIES) {
catPromise = fetch(CATEGORY_URL)
.then(response => response.json())
.catch(() => handleError(domainMsg('categories')))
}
let narPromise = Promise.resolve([])
if (features.USE_NARRATIVES) {