diff --git a/frontend/src/utilities/useAcceleratorState.ts b/frontend/src/utilities/useAcceleratorState.ts index 83a55cce42..08f9f0175d 100644 --- a/frontend/src/utilities/useAcceleratorState.ts +++ b/frontend/src/utilities/useAcceleratorState.ts @@ -31,7 +31,7 @@ const useAcceleratorState = ( }); const { dashboardNamespace } = useDashboardNamespace(); - const [accelerators, loaded, loadError] = useAccelerators(dashboardNamespace); + const [accelerators, loaded, loadError, refresh] = useAccelerators(dashboardNamespace); React.useEffect(() => { if (loaded && !loadError) { @@ -124,7 +124,12 @@ const useAcceleratorState = ( } }, [accelerators, loaded, loadError, resources, tolerations, existingAcceleratorName, setData]); - return [acceleratorState, setData, resetData]; + const resetDataAndRefresh = React.useCallback(() => { + resetData(); + refresh(); + }, [refresh, resetData]); + + return [acceleratorState, setData, resetDataAndRefresh]; }; export default useAcceleratorState;