mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Fix an error in fetch.ts (probably the source of these build issues)
This commit is contained in:
parent
fad6316020
commit
7495d51408
1 changed files with 6 additions and 1 deletions
|
@ -69,7 +69,12 @@ export async function singularProxiedFetch<T>(
|
||||||
onResponse(context) {
|
onResponse(context) {
|
||||||
const tokenHeader = context.response.headers.get("X-Token");
|
const tokenHeader = context.response.headers.get("X-Token");
|
||||||
if (tokenHeader) setApiToken(tokenHeader);
|
if (tokenHeader) setApiToken(tokenHeader);
|
||||||
|
|
||||||
|
if (Array.isArray(ops.onResponse)) {
|
||||||
|
ops.onResponse.forEach((hook) => hook(context));
|
||||||
|
} else {
|
||||||
ops.onResponse?.(context);
|
ops.onResponse?.(context);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue