Wizard: Prefetch the list of activation keys on Image output step

This prefetches the list of activation keys upon entering the Wizard, making the loading times on the Registration step better for the user.
This commit is contained in:
regexowl 2024-11-14 11:23:37 +01:00 committed by Lucas Garfield
parent 4637a2a5d8
commit b8c852c836

View file

@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import {
Button,
@ -20,6 +20,7 @@ import {
useGetArchitecturesQuery,
} from '../../../../store/imageBuilderApi';
import { provisioningApi } from '../../../../store/provisioningApi';
import { rhsmApi } from '../../../../store/rhsmApi';
import {
addImageType,
reinitializeAws,
@ -49,6 +50,11 @@ const TargetEnvironment = () => {
const dispatch = useAppDispatch();
const prefetchSources = provisioningApi.usePrefetch('getSourceList');
const prefetchActivationKeys = rhsmApi.usePrefetch('listActivationKeys');
useEffect(() => {
prefetchActivationKeys();
}, []);
const supportedEnvironments = data?.find(
(elem) => elem.arch === arch