From 9c5c103a655a2ecbd58d8d6a7f97225628c61430 Mon Sep 17 00:00:00 2001 From: Pylogmon Date: Thu, 15 Jun 2023 10:08:30 +0800 Subject: [PATCH] fix: Copy once --- .../components/TargetArea/index.jsx | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/windows/Translator/components/TargetArea/index.jsx b/src/windows/Translator/components/TargetArea/index.jsx index 68e6ee2692..ce78f2f87d 100644 --- a/src/windows/Translator/components/TargetArea/index.jsx +++ b/src/windows/Translator/components/TargetArea/index.jsx @@ -59,20 +59,22 @@ export default function TargetArea(props) { } else { setTargetTextSetNum(0); } - if (!targetText.endsWith('_')) { - let autoCopy = get('auto_copy') ?? 4; - if (!listenCopy) { - if (autoCopy === 1) { - if (sourceText !== '') { - copy(sourceText); - } - } else if (autoCopy === 2) { - if (targetText !== '') { - copy(targetText); - } - } else if (autoCopy === 3) { - if (targetText && sourceText !== '') { - copy(sourceText + '\n\n' + targetText); + if (q === 0) { + if (!targetText.endsWith('_')) { + let autoCopy = get('auto_copy') ?? 4; + if (!listenCopy) { + if (autoCopy === 1) { + if (sourceText !== '') { + copy(sourceText); + } + } else if (autoCopy === 2) { + if (targetText !== '') { + copy(targetText); + } + } else if (autoCopy === 3) { + if (targetText && sourceText !== '') { + copy(sourceText + '\n\n' + targetText); + } } } }