bugfix: fix missing condition to open disconnect modal when backend is down (#2993)

🐛 (App.tsx): Fix logic to correctly display error modal when health data is missing or not "ok"
🔧 (use-get-health.ts): Disable retry option in useGetHealthQuery to prevent unnecessary refetching of health data
This commit is contained in:
Cristhian Zanforlin Lousa 2024-07-26 16:06:49 -03:00 committed by GitHub
commit ac77cee699
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -137,6 +137,7 @@ export default function App() {
message={FETCH_ERROR_MESSAGE}
openModal={
isErrorHealth ||
!healthData ||
(healthData &&
Object.values(healthData).some((value) => value !== "ok"))
}

View file

@ -30,6 +30,7 @@ export const useGetHealthQuery: useQueryFunctionType<
const queryResult = query(["useGetHealthQuery"], getHealthFn, {
placeholderData: keepPreviousData,
refetchInterval: 20000,
retry: false,
...options,
});