From 649b848588eade92768bcaa14a2af3229ef50617 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Thu, 26 Aug 2021 11:26:29 +0300 Subject: [PATCH] disable check hashes on save urls FIXME! --- web/src/components/Add/AddDialog.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/components/Add/AddDialog.jsx b/web/src/components/Add/AddDialog.jsx index f5649a8..01e146f 100644 --- a/web/src/components/Add/AddDialog.jsx +++ b/web/src/components/Add/AddDialog.jsx @@ -67,7 +67,10 @@ export default function AddDialog({ const allHashes = torrents.map(({ hash }) => hash) allHashes.includes(currentSourceHash) && handleClose() - }, [isSaving, torrents, currentSourceHash, handleClose]) + // FIXME! check api reply on add links + const linkRegex = /^(http(s?)):\/\/.*/i + torrentSource.match(linkRegex) !== null && handleClose() + }, [isSaving, torrents, torrentSource, currentSourceHash, handleClose]) const fullScreen = useMediaQuery('@media (max-width:930px)')