Improve dashboard loading and task sync

This commit is contained in:
2026-05-19 02:32:22 +02:00
parent cc21c5869e
commit c7150bae5f
4 changed files with 194 additions and 63 deletions

View File

@@ -28,10 +28,11 @@ export async function waitForVisible(ms) {
export async function apiFetch(path, options = {}) {
const url = path.startsWith("http") ? path : `${API}${path}`;
const timeout = options.timeout ?? FETCH_TIMEOUT;
const {timeout: _timeout, ...fetchOptions} = options;
const ctrl = new AbortController();
const timer = setTimeout(() => ctrl.abort(), timeout);
try {
return await fetch(url, {...options, signal: ctrl.signal});
return await fetch(url, {cache: "no-store", ...fetchOptions, signal: ctrl.signal});
} finally {
clearTimeout(timer);
}