Skip to content

Commit

Permalink
Set loading when changing provider
Browse files Browse the repository at this point in the history
Signed-off-by: yaacov <[email protected]>
  • Loading branch information
yaacov committed Jun 25, 2024
1 parent 4750252 commit 562327a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ProviderVirtualMachinesListWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export const useProviderInventory = <T>({

// Fetch data from API
useEffect(() => {
setLoading(true);

const fetchData = async () => {
if (disabled) {
return;
Expand Down

0 comments on commit 562327a

Please sign in to comment.