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:
commit
f065bb37cc
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