Skip to content

Commit d827fc5

Browse files
committed
chore: internet connectivity banner flag
1 parent 3faeb27 commit d827fc5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export const useOnline = ({ onOnline = noop }: { onOnline?: () => void }) => {
1111
const timeoutRef = useRef<NodeJS.Timeout>(null)
1212
const { isAirgapped } = useMainContext()
1313

14+
const hideInternetConnectivityBanner = isAirgapped || window._env_.FEATURE_INTERNET_CONNECTIVITY_ENABLE
15+
1416
const handleClearTimeout = () => {
1517
if (timeoutRef.current) {
1618
clearTimeout(timeoutRef.current)
@@ -27,7 +29,7 @@ export const useOnline = ({ onOnline = noop }: { onOnline?: () => void }) => {
2729
}
2830

2931
const checkConnectivity = async () => {
30-
if (isAirgapped) return
32+
if (hideInternetConnectivityBanner) return
3133

3234
handleClearTimeout()
3335
const controller = new AbortController()
@@ -78,7 +80,7 @@ export const useOnline = ({ onOnline = noop }: { onOnline?: () => void }) => {
7880
}, [])
7981

8082
useEffect(() => {
81-
if (isAirgapped) return null
83+
if (hideInternetConnectivityBanner) return null
8284
window.addEventListener('online', handleOnline)
8385
window.addEventListener('offline', handleOffline)
8486

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ if (!window || !window._env_) {
144144
ENABLE_EXTERNAL_ARGO_CD: true,
145145
API_BATCH_SIZE: 20,
146146
FEATURE_USER_DEFINED_GITOPS_REPO_ENABLE: true,
147+
FEATURE_INTERNET_CONNECTIVITY_ENABLE: true,
147148
SERVICE_WORKER_TIMEOUT: '3',
148149
HIDE_RELEASES: false,
149150
HIDE_RESOURCE_WATCHER: false,

0 commit comments

Comments
 (0)