Skip to content

Commit

Permalink
fix(config-ui): existing config value will be missed (#6184)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsweet authored Oct 7, 2023
1 parent 62a1e93 commit d5288c9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface Props {
}

export const RemoteLink = ({ transformation, setTransformation }: Props) => {
const [index, setInedx] = useState(0);
const [index, setInedx] = useState<number>();
const [pattern, setPattern] = useState('');
const [error, setError] = useState('');
const [links, setLinks] = useState<Array<{ pattern: string; regex: string }>>(
Expand All @@ -56,7 +56,7 @@ export const RemoteLink = ({ transformation, setTransformation }: Props) => {
});

if (success) {
setLinks(links.map((link, i) => (i === index ? res : link)));
setLinks(links.map((link, i) => (i === index ? { ...res, pattern } : link)));
} else {
setError(res?.response?.data?.message ?? '');
}
Expand Down

0 comments on commit d5288c9

Please sign in to comment.