Plugins Catalog: Fix plugin details page initial flickering (#83896)

fix: wait for the local and remote fetches to fulfill
This commit is contained in:
Levente Balogh
2024-03-05 14:23:29 +01:00
committed by GitHub
parent 05865034d7
commit fdd2c1c59e

View File

@@ -84,7 +84,10 @@ export const useLocalFetchStatus = () => {
};
export const useFetchStatus = () => {
const isLoading = useSelector(selectIsRequestPending(fetchAll.typePrefix));
const isAllLoading = useSelector(selectIsRequestPending(fetchAll.typePrefix));
const isLocalLoading = useSelector(selectIsRequestPending('plugins/fetchLocal'));
const isRemoteLoading = useSelector(selectIsRequestPending('plugins/fetchRemote'));
const isLoading = isAllLoading || isLocalLoading || isRemoteLoading;
const error = useSelector(selectRequestError(fetchAll.typePrefix));
return { isLoading, error };