From 562327ac97046d593547fc07b22fae8ba47f2806 Mon Sep 17 00:00:00 2001 From: yaacov Date: Tue, 25 Jun 2024 12:57:08 +0300 Subject: [PATCH] Set loading when changing provider Signed-off-by: yaacov --- .../views/create/components/ProvidersVirtualMachinesList.tsx | 2 +- .../src/modules/Providers/hooks/useProviderInventory.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/forklift-console-plugin/src/modules/Plans/views/create/components/ProvidersVirtualMachinesList.tsx b/packages/forklift-console-plugin/src/modules/Plans/views/create/components/ProvidersVirtualMachinesList.tsx index b13a86b7d..e1b730b7d 100644 --- a/packages/forklift-console-plugin/src/modules/Plans/views/create/components/ProvidersVirtualMachinesList.tsx +++ b/packages/forklift-console-plugin/src/modules/Plans/views/create/components/ProvidersVirtualMachinesList.tsx @@ -25,7 +25,7 @@ export const ProviderVirtualMachinesList: React.FC<{ }); const [vmData, vmDataLoading] = useInventoryVms({ provider }, providerLoaded, providerLoadError); - const obj = { provider, vmData, vmDataLoading: vmDataLoading || vmData?.length === 0 }; + const obj = { provider, vmData, vmDataLoading: vmDataLoading }; return ( ({ // Fetch data from API useEffect(() => { + setLoading(true); + const fetchData = async () => { if (disabled) { return;