fix(frontend): new radarr/sonarr ports will be converted to a number before posting

This commit is contained in:
sct
2020-12-14 06:37:34 +00:00
parent 5f09e83ed8
commit 92c9001c9d
4 changed files with 114 additions and 118 deletions

View File

@@ -63,9 +63,7 @@ const Modal: React.FC<ModalProps> = ({
}); });
useLockBodyScroll(true, disableScrollLock); useLockBodyScroll(true, disableScrollLock);
return ( return ReactDOM.createPortal(
<>
{ReactDOM.createPortal(
// eslint-disable-next-line jsx-a11y/no-static-element-interactions // eslint-disable-next-line jsx-a11y/no-static-element-interactions
<div <div
className="fixed top-0 left-0 right-0 bottom-0 bg-gray-800 bg-opacity-50 w-full h-full z-50 flex justify-center items-center" className="fixed top-0 left-0 right-0 bottom-0 bg-gray-800 bg-opacity-50 w-full h-full z-50 flex justify-center items-center"
@@ -181,8 +179,6 @@ const Modal: React.FC<ModalProps> = ({
</Transition> </Transition>
</div>, </div>,
document.body document.body
)}
</>
); );
}; };

View File

@@ -108,7 +108,7 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
{ {
hostname, hostname,
apiKey, apiKey,
port, port: Number(port),
baseUrl, baseUrl,
useSsl, useSsl,
} }

View File

@@ -111,7 +111,7 @@ const SonarrModal: React.FC<SonarrModalProps> = ({
{ {
hostname, hostname,
apiKey, apiKey,
port, port: Number(port),
baseUrl, baseUrl,
useSsl, useSsl,
} }

View File

@@ -15,7 +15,7 @@ const useClickOutside = (
): void => { ): void => {
useEffect(() => { useEffect(() => {
const handleBodyClick = (e: MouseEvent) => { const handleBodyClick = (e: MouseEvent) => {
if (!ref.current?.contains(e.target as Node)) { if (ref.current && !ref.current.contains(e.target as Node)) {
callback(e); callback(e);
} }
}; };