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:
parent
36561e24b4
commit
20f1c5140b
2 changed files with 4 additions and 0 deletions
|
@ -4,3 +4,4 @@ export * from './connectors';
|
|||
export * from './logs';
|
||||
|
||||
export const themeStorageKey = 'logto:admin_console:theme';
|
||||
export const requestTimeout = 20_000;
|
||||
|
|
|
@ -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
|
||||
? []
|
||||
|
|
Loading…
Reference in a new issue