Skip to content

Commit 4d5eef2

Browse files
committed
chore: internet connectivity code clean up
1 parent f9c7ca8 commit 4d5eef2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/common/hooks/useOnline/service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Routes } from '@Config/constants'
22

3-
const DEFAULT_TIMEOUT = 20000
3+
import { INTERNET_CONNECTIVITY_INTERVAL } from '../constants'
44

55
const fetchWithTimeout = (url: string, options: RequestInit, controller: AbortController): Promise<any> => {
6-
const timeoutId = setTimeout(() => controller.abort(), DEFAULT_TIMEOUT)
6+
const timeoutId = setTimeout(() => controller.abort(), INTERNET_CONNECTIVITY_INTERVAL)
77

88
return fetch(url, { ...options, signal: controller.signal }).finally(() => clearTimeout(timeoutId))
99
}

0 commit comments

Comments
 (0)