diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-22 09:55:38 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-22 09:55:38 +0900 |
| commit | 1e67e9c6616c6e87ae85ece71e5401006df2dd34 (patch) | |
| tree | a0d6df03a3d0ac2edf1fda7ed4bfb789b5a29720 /packages/frontend/src/scripts/api.ts | |
| parent | Merge pull request #10218 from misskey-dev/develop (diff) | |
| parent | fix drive-cleaner (diff) | |
| download | misskey-1e67e9c6616c6e87ae85ece71e5401006df2dd34.tar.gz misskey-1e67e9c6616c6e87ae85ece71e5401006df2dd34.tar.bz2 misskey-1e67e9c6616c6e87ae85ece71e5401006df2dd34.zip | |
Merge pull request #10342 from misskey-dev/develop
Release: 13.10.0
Diffstat (limited to 'packages/frontend/src/scripts/api.ts')
| -rw-r--r-- | packages/frontend/src/scripts/api.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/frontend/src/scripts/api.ts b/packages/frontend/src/scripts/api.ts index 5f34f5333e..97081d170f 100644 --- a/packages/frontend/src/scripts/api.ts +++ b/packages/frontend/src/scripts/api.ts @@ -5,7 +5,7 @@ import { $i } from '@/account'; export const pendingApiRequestsCount = ref(0); // Implements Misskey.api.ApiClient.request -export function api<E extends keyof Endpoints, P extends Endpoints[E]['req']>(endpoint: E, data: P = {} as any, token?: string | null | undefined): Promise<Endpoints[E]['res']> { +export function api<E extends keyof Endpoints, P extends Endpoints[E]['req']>(endpoint: E, data: P = {} as any, token?: string | null | undefined, signal?: AbortSignal): Promise<Endpoints[E]['res']> { pendingApiRequestsCount.value++; const onFinally = () => { @@ -26,6 +26,7 @@ export function api<E extends keyof Endpoints, P extends Endpoints[E]['req']>(en headers: { 'Content-Type': 'application/json', }, + signal, }).then(async (res) => { const body = res.status === 204 ? null : await res.json(); |