diff --git a/CHANGELOG.md b/CHANGELOG.md index e95ce5e3b..939fdd18e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * Include `yarn.lock`. Refs STCOR-679. * *BREAKING* bump `react-intl` to `v6.4.4`. Refs STCOR-744. * Bump `stylelint` to `v15` and `stylelint-config-standard` to `v34`. Refs STCOR-745. +* Read ky timeout from stripes-config value. Refs STCOR-594. * *BREAKING* use cookies and RTR instead of directly handling the JWT. Refs STCOR-671, FOLIO-3627. ## [9.0.0](https://github.com/folio-org/stripes-core/tree/v9.0.0) (2023-01-30) diff --git a/src/useOkapiKy.js b/src/useOkapiKy.js index 7f7a0ab39..db39ff47c 100644 --- a/src/useOkapiKy.js +++ b/src/useOkapiKy.js @@ -2,7 +2,8 @@ import ky from 'ky'; import { useStripes } from './StripesContext'; export default () => { - const { locale = 'en', tenant, url } = useStripes().okapi; + const { locale = 'en', tenant, timeout = 30000, url } = useStripes().okapi; + return ky.create({ credentials: 'include', hooks: { @@ -16,6 +17,6 @@ export default () => { mode: 'cors', prefix: url, retry: 0, - timeout: 30000, + timeout, }); };