update lots of reader fixes
This commit is contained in:
+16
-8
@@ -133,18 +133,26 @@
|
||||
: undefined;
|
||||
}
|
||||
|
||||
async function fetchJson(path) {
|
||||
async function fetchJson(path, { timeoutMs = 30000 } = {}) {
|
||||
if (!path) {
|
||||
throw new Error("API connection is not configured.");
|
||||
}
|
||||
|
||||
const response = await fetch(path, {
|
||||
headers: buildRequestHeaders()
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to load ${path} (${response.status})`);
|
||||
const controller = new AbortController();
|
||||
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
||||
|
||||
try {
|
||||
const response = await fetch(path, {
|
||||
headers: buildRequestHeaders(),
|
||||
signal: controller.signal
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to load ${path} (${response.status})`);
|
||||
}
|
||||
return response.json();
|
||||
} finally {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
return response.json();
|
||||
}
|
||||
|
||||
function buildObjectPath(target, pathParts, value) {
|
||||
@@ -240,7 +248,7 @@
|
||||
}
|
||||
|
||||
const activeSection = String(window.TarotSectionStateUi?.getActiveSection?.() || "home").trim();
|
||||
return activeSection === "home";
|
||||
return activeSection === "home" || activeSection === "sky";
|
||||
}
|
||||
|
||||
function toApiAssetUrl(assetPath) {
|
||||
|
||||
Reference in New Issue
Block a user