mirror of https://github.com/portainer/portainer
fix(edge-stack): revert useEffect, to call matchRegistry less often [BE-11501] (#239)
parent
94fda6a720
commit
117e3500ae
|
@ -1,5 +1,4 @@
|
|||
import _ from 'lodash';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { notifyError } from '@/portainer/services/notifications';
|
||||
import { PrivateRegistryFieldset } from '@/react/edge/edge-stacks/components/PrivateRegistryFieldset';
|
||||
|
@ -32,11 +31,6 @@ export function PrivateRegistryFieldsetWrapper({
|
|||
|
||||
const registriesQuery = useRegistries({ hideDefault: true });
|
||||
|
||||
useEffect(() => {
|
||||
matchRegistry(values);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [values.file, values.fileContent]);
|
||||
|
||||
if (!registriesQuery.data) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { useMutation } from '@tanstack/react-query';
|
||||
|
||||
import { withGlobalError } from '@/react-tools/react-query';
|
||||
import { RegistryId } from '@/react/portainer/registries/types/registry';
|
||||
import axios, {
|
||||
json2formData,
|
||||
|
@ -10,9 +9,10 @@ import axios, {
|
|||
import { buildUrl } from './buildUrl';
|
||||
|
||||
export function useParseRegistries() {
|
||||
return useMutation(parseRegistries, {
|
||||
...withGlobalError('Failed parsing registries'),
|
||||
});
|
||||
return useMutation(
|
||||
parseRegistries
|
||||
// handle errors in the calling function (notifyError vs setting form errors in validation)
|
||||
);
|
||||
}
|
||||
|
||||
export async function parseRegistries({
|
||||
|
|
Loading…
Reference in New Issue