Skip to content

Commit

Permalink
fix: Copy once
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Jun 15, 2023
1 parent 442105b commit 9c5c103
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/windows/Translator/components/TargetArea/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down

0 comments on commit 9c5c103

Please sign in to comment.