0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

Merge pull request #1957 from logto-io/charles-log-4200-increase-ky-timeout-to-20s

chore(console): increase ky request timeout to 20s (fixes #1798)
This commit is contained in:
Charles Zhao 2022-09-17 21:09:54 +08:00 committed by GitHub
commit f065bb37cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -4,3 +4,4 @@ export * from './connectors';
export * from './logs';
export const themeStorageKey = 'logto:admin_console:theme';
export const requestTimeout = 20_000;

View file

@ -7,6 +7,8 @@ import { useMemo } from 'react';
import { toast } from 'react-hot-toast';
import { useTranslation } from 'react-i18next';
import { requestTimeout } from '@/consts';
export class RequestError extends Error {
status: number;
body?: RequestErrorBody;
@ -38,6 +40,7 @@ const useApi = ({ hideErrorToast }: Props = {}) => {
const api = useMemo(
() =>
ky.create({
timeout: requestTimeout,
hooks: {
beforeError: hideErrorToast
? []