0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore(console): increase ky request timeout to 20s

This commit is contained in:
Charles Zhao 2022-09-17 15:12:51 +08:00
parent 36561e24b4
commit 20f1c5140b
No known key found for this signature in database
GPG key ID: 4858774754C92DF2
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
? []