UI - Add timeout before refetching queries (#13009)

## Addresses #13007 

Avoid race condition by waiting before queries refetch after updating
automations

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
Jacob Shandling 2023-07-27 14:44:03 -07:00 committed by GitHub
parent 38b4407671
commit 791adf19ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -368,7 +368,8 @@ const ManageQueriesPage = ({
try {
await Promise.all(updateAutomatedQueries).then(() => {
renderFlash("success", `Successfully updated query automations.`);
refetchAllQueries();
// allow time for backend to update before refetching
setTimeout(refetchAllQueries, 10);
});
} catch (errorResponse) {
renderFlash(