fix: make sure loading is true when refetching

This commit is contained in:
Rafael Taranto 2025-06-23 10:21:27 +01:00
parent f1e5edd4ac
commit 268f2d68fd
3 changed files with 7 additions and 2 deletions

View file

@ -296,6 +296,7 @@ const CustomerProfile = memo(() => {
refetch: getCustomer,
loading: customerLoading,
} = useQuery(GET_CUSTOMER, {
notifyOnNetworkStatusChange: true,
variables: { customerId },
skip: !customerId,
})

View file

@ -61,7 +61,7 @@ const MachineStatus = () => {
data: machinesResponse,
refetch,
loading: machinesLoading,
} = useQuery(GET_MACHINES)
} = useQuery(GET_MACHINES, { notifyOnNetworkStatusChange: true })
const { data: configResponse, configLoading } = useQuery(GET_DATA)
const timezone = R.path(['config', 'locale_timezone'], configResponse)

View file

@ -59,7 +59,11 @@ const GET_CUSTOM_REQUESTS = gql`
const Triggers = () => {
const [wizardType, setWizard] = useState(false)
const { data, loading: configLoading, refetch } = useQuery(GET_CONFIG)
const {
data,
loading: configLoading,
refetch,
} = useQuery(GET_CONFIG, { notifyOnNetworkStatusChange: true })
const { data: customInfoReqData, loading: customInfoLoading } =
useQuery(GET_CUSTOM_REQUESTS)
const [error, setError] = useState(null)