mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Compare commits
2 commits
5d2bad7a92
...
62ce568c21
Author | SHA1 | Date | |
---|---|---|---|
|
62ce568c21 | ||
|
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