mirror of https://github.com/jetkvm/kvm.git
Fix ref lint warning
This commit is contained in:
parent
a40c27269a
commit
5613555b39
|
|
@ -352,6 +352,7 @@ function UrlView({
|
|||
}) {
|
||||
const [usbMode, setUsbMode] = useState<RemoteVirtualMediaState["mode"]>("CDROM");
|
||||
const [url, setUrl] = useState<string>("");
|
||||
const [isUrlValid, setIsUrlValid] = useState(false);
|
||||
|
||||
const popularImages = [
|
||||
{
|
||||
|
|
@ -399,6 +400,12 @@ function UrlView({
|
|||
|
||||
const urlRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (urlRef.current) {
|
||||
setIsUrlValid(urlRef.current.validity.valid);
|
||||
}
|
||||
}, [url]);
|
||||
|
||||
function handleUrlChange(url: string) {
|
||||
setUrl(url);
|
||||
if (url.endsWith(".iso")) {
|
||||
|
|
@ -437,7 +444,7 @@ function UrlView({
|
|||
animationDelay: "0.1s",
|
||||
}}
|
||||
>
|
||||
<Fieldset disabled={!urlRef.current?.validity.valid || url.length === 0}>
|
||||
<Fieldset disabled={!isUrlValid || url.length === 0}>
|
||||
<UsbModeSelector usbMode={usbMode} setUsbMode={setUsbMode} />
|
||||
</Fieldset>
|
||||
<div className="flex space-x-2">
|
||||
|
|
@ -449,7 +456,7 @@ function UrlView({
|
|||
text={m.mount_button_mount_url()}
|
||||
onClick={() => onMount(url, usbMode)}
|
||||
disabled={
|
||||
mountInProgress || !urlRef.current?.validity.valid || url.length === 0
|
||||
mountInProgress || !isUrlValid || url.length === 0
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue