Skip to content

Commit

Permalink
BUGFIX: fix disallowed hooks call in weblink editor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrehoffmann30 authored Jan 8, 2024
1 parent 4ba4193 commit fbe441a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Neos.Ui/core/src/application/LinkTypes/Web/Web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const Web = makeLinkType<WebLinkModel>('Sitegeist.Archaeopteryx:Web', ({c
const [protocol, setProtocol] = useState<string>("");

const i18n = useI18n();
const form = useForm();

return (
<div>
Expand All @@ -86,7 +87,7 @@ export const Web = makeLinkType<WebLinkModel>('Sitegeist.Archaeopteryx:Web', ({c
}

if(value === undefined){
useForm().change('linkTypeProps.Sitegeist_Archaeopteryx:Web.protocol', protocol);
form.change('linkTypeProps.Sitegeist_Archaeopteryx:Web.protocol', protocol);
}
return value;
}}
Expand Down Expand Up @@ -128,7 +129,7 @@ export const Web = makeLinkType<WebLinkModel>('Sitegeist.Archaeopteryx:Web', ({c
if (matches) {
const [, protocol, urlWithoutProtocol] = matches;

useForm().change('linkTypeProps.Sitegeist_Archaeopteryx:Web.protocol', protocol);
form.change('linkTypeProps.Sitegeist_Archaeopteryx:Web.protocol', protocol);
return urlWithoutProtocol;
}
return value;
Expand Down

0 comments on commit fbe441a

Please sign in to comment.