ai generated solutions to our ai generated problems
This commit is contained in:
@@ -51,7 +51,7 @@ const siteVersion = '1.0.1'
|
||||
|
||||
const turnstileSiteKey = import.meta.env.VITE_TURNSTILE_SITE_KEY || ''
|
||||
const staticDataBase = (import.meta.env.VITE_STATIC_DATA_BASE || '/data').replace(/\/+$/, '')
|
||||
const staticDataEnabled = String(import.meta.env.VITE_STATIC_DATA || 'false').toLowerCase() === 'true'
|
||||
const staticDataEnabled = String(import.meta.env.VITE_STATIC_DATA || 'true').toLowerCase() !== 'false'
|
||||
const missingStaticDataPaths = new Set()
|
||||
|
||||
const defaultAnalyticsPreferences = {
|
||||
@@ -126,8 +126,11 @@ async function fetchPublicJson(source, signal) {
|
||||
return await fetchJson(source.staticPath, signal)
|
||||
} catch (error) {
|
||||
if (signal?.aborted || error?.name === 'AbortError') throw error
|
||||
if (error?.status === 404 || error?.contentType) missingStaticDataPaths.add(source.staticPath)
|
||||
return fetchJson(source.apiPath, signal)
|
||||
if (error?.status === 404 || error?.contentType) {
|
||||
missingStaticDataPaths.add(source.staticPath)
|
||||
return fetchJson(source.apiPath, signal)
|
||||
}
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user