Wizard: race condition with activation key

Fixes #2961

Activation key loads in background even if a user skips to the review step.
The unwrap is there to extract only the actual response data, if the query fails, the exception will be caught in the catch block anyways, so there was no need to keep the whole action object.
And the refetch was being called before the createActivationKey query was initiallized, throwing an error and not letting the async query in try block to finish fetching the activation key.
This commit is contained in:
Katarina Sieklova 2025-03-12 14:04:57 +01:00 committed by Klara Simickova
parent 756e7427d6
commit 17f975e0ef

View file

@ -164,12 +164,12 @@ const ActivationKeysList = () => {
name: defaultActivationKeyName,
serviceLevel: 'Self-Support',
},
});
}).unwrap();
window.localStorage.setItem(
'imageBuilder.recentActivationKey',
defaultActivationKeyName
);
refetch();
dispatch(changeActivationKey(defaultActivationKeyName));
} catch (error) {
dispatch(