add refresh button

This commit is contained in:
Alex Holliday committed 2025-07-14 16:26:34 -07:00
1 parent 39779b9dd5
commit f62350fea0
2 files changed
+28 -14

No files matched your search

+16 -12
View File
@@ -89,22 +89,26 @@ const useFetchDiagnostics = () => {
const [error, setError] = useState(undefined);
const [diagnostics, setDiagnostics] = useState(undefined);
const fetchDiagnostics = async () => {
try {
setIsLoading(true);
const response = await networkService.getDiagnostics();
setDiagnostics(response.data.data);
} catch (error) {
createToast({
body: error.message,
});
setError(error);
} finally {
setIsLoading(false);
}
};
useEffect(() => {
const fetchDiagnostics = async () => {
try {
setIsLoading(true);
const response = await networkService.getDiagnostics();
setDiagnostics(response.data.data);
} catch (error) {
setError(error);
} finally {
setIsLoading(false);
}
};
fetchDiagnostics();
}, []);
return [diagnostics, isLoading, error];
return [diagnostics, fetchDiagnostics, isLoading, error];
};
export { useFetchLogs, useFetchQueueData, useFlushQueue, useFetchDiagnostics };