diff --git a/public/app/store/configureStore.ts b/public/app/store/configureStore.ts index 7859c388204..a7a462bf3a8 100644 --- a/public/app/store/configureStore.ts +++ b/public/app/store/configureStore.ts @@ -1,4 +1,5 @@ import { configureStore as reduxConfigureStore, createListenerMiddleware } from '@reduxjs/toolkit'; +import { setupListeners } from '@reduxjs/toolkit/query'; import { browseDashboardsAPI } from 'app/features/browse-dashboards/api/browseDashboardsAPI'; import { publicDashboardApi } from 'app/features/dashboard/api/publicDashboardApi'; @@ -36,6 +37,9 @@ export function configureStore(initialState?: Partial) { }, }); + // this enables "refetchOnFocus" and "refetchOnReconnect" for RTK Query + setupListeners(store.dispatch); + setStore(store); return store; }