fix forms stale (#419)

* feat: create loader component

* fix: prevent stale data in forms
This commit is contained in:
Carlos Valente
2023-05-28 22:21:31 +02:00
committed by GitHub
parent f6e524e865
commit c075f73752
19 changed files with 189 additions and 26 deletions
@@ -6,7 +6,7 @@ import { getSettings } from '../api/ontimeApi';
import { ontimePlaceholderSettings } from '../models/OntimeSettings';
export default function useSettings() {
const { data, status, isError, refetch } = useQuery({
const { data, status, isFetching, isError, refetch } = useQuery({
queryKey: APP_SETTINGS,
queryFn: getSettings,
placeholderData: ontimePlaceholderSettings,
@@ -16,5 +16,5 @@ export default function useSettings() {
networkMode: 'always',
});
return { data, status, isError, refetch };
return { data, status, isFetching, isError, refetch };
}