From 1d93fe0de096c6dee396047e8f5cd26cfa3091c9 Mon Sep 17 00:00:00 2001 From: whyour Date: Fri, 18 Aug 2023 09:17:18 +0800 Subject: [PATCH] =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E7=B2=98=E8=B4=B4=20ql=20=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/subscription/modal.tsx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/pages/subscription/modal.tsx b/src/pages/subscription/modal.tsx index 21d8ffb3..bac0cf9c 100644 --- a/src/pages/subscription/modal.tsx +++ b/src/pages/subscription/modal.tsx @@ -241,10 +241,9 @@ const SubscriptionModal = ({ const onNamePaste = useCallback((e) => { const text = e.clipboardData.getData('text') as string; - if (text.startsWith('ql ')) { + if (text.includes('ql repo') || text.includes('ql raw')) { e.preventDefault(); } - onPaste(e); }, []); const formatParams = (sub) => { @@ -330,7 +329,7 @@ const SubscriptionModal = ({ rows={4} autoSize={true} placeholder={intl.get('请输入订阅链接')} - onPaste={onUrlChange} + onPaste={onNamePaste} onChange={onUrlChange} /> @@ -338,7 +337,7 @@ const SubscriptionModal = ({ @@ -401,7 +400,10 @@ const SubscriptionModal = ({ {scheduleType === 'interval' ? ( ) : ( - + )} {type !== 'file' && ( @@ -417,6 +419,7 @@ const SubscriptionModal = ({ placeholder={intl.get( '请输入脚本筛选白名单关键词,多个关键词竖线分割', )} + onPaste={onNamePaste} /> - +