|
1 | | -import React from 'react'; |
2 | | - |
3 | 1 | import type {AlertProps} from '@gravity-ui/uikit'; |
4 | 2 | import {Alert, Button, Flex, Icon, Popover, Skeleton} from '@gravity-ui/uikit'; |
5 | 3 |
|
@@ -52,36 +50,12 @@ export function HealthcheckPreview(props: HealthcheckPreviewProps) { |
52 | 50 | { |
53 | 51 | //FIXME https://github.com/ydb-platform/ydb-embedded-ui/issues/1889 |
54 | 52 | pollingInterval: healthcheckPreviewDisabled ? undefined : autoRefreshInterval, |
55 | | - skip: healthcheckPreviewDisabled, |
56 | 53 | }, |
57 | 54 | ); |
58 | 55 |
|
59 | | - const [getHealthcheckQuery, {currentData: manualData, isFetching: isFetchingManually}] = |
60 | | - healthcheckApi.useLazyGetHealthcheckInfoQuery(); |
61 | | - |
62 | | - React.useEffect(() => { |
63 | | - if (healthcheckPreviewDisabled) { |
64 | | - getHealthcheckQuery({database: tenantName}); |
65 | | - } |
66 | | - }, [healthcheckPreviewDisabled, tenantName, getHealthcheckQuery]); |
| 56 | + const loading = isFetching && data === undefined; |
67 | 57 |
|
68 | | - React.useEffect(() => { |
69 | | - const fetchHealthcheck = () => { |
70 | | - if (healthcheckPreviewDisabled) { |
71 | | - getHealthcheckQuery({database: tenantName}); |
72 | | - } |
73 | | - }; |
74 | | - document.addEventListener('diagnosticsRefresh', fetchHealthcheck); |
75 | | - return () => { |
76 | | - document.removeEventListener('diagnosticsRefresh', fetchHealthcheck); |
77 | | - }; |
78 | | - }, [tenantName, healthcheckPreviewDisabled, getHealthcheckQuery]); |
79 | | - |
80 | | - const loading = |
81 | | - (isFetching && data === undefined) || (isFetchingManually && manualData === undefined); |
82 | | - |
83 | | - const selfCheckResult: SelfCheckResult = |
84 | | - data?.self_check_result || manualData?.self_check_result || SelfCheckResult.UNSPECIFIED; |
| 58 | + const selfCheckResult: SelfCheckResult = data?.self_check_result || SelfCheckResult.UNSPECIFIED; |
85 | 59 |
|
86 | 60 | const modifier = selfCheckResult.toLowerCase(); |
87 | 61 |
|
|
0 commit comments