summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
Diffstat (limited to 'src/content')
-rw-r--r--src/content/content.js13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/content/content.js b/src/content/content.js
index e1e6823..fa5f416 100644
--- a/src/content/content.js
+++ b/src/content/content.js
@@ -56,8 +56,6 @@
let currentSelectionRect = null;
/** @type {string|null} id of the request the popover currently shows */
let activeRequestId = null;
- /** @type {string|null} source text of the last request (for regenerate) */
- let lastSourceText = null;
// ---------------------------------------------------------------------
// 2. Selection controller
@@ -364,7 +362,7 @@
});
regenerateButton.addEventListener('click', () => {
if (localLastSourceText) {
- requestTranslation(localLastSourceText);
+ portClient.translate(localLastSourceText);
}
});
}
@@ -551,7 +549,6 @@
const p = connect();
const requestId = generateRequestId();
activeRequestId = requestId;
- lastSourceText = text;
popover.beginRequest(text, currentSelectionRect || { left: 16, top: 16, bottom: 40, right: 356 });
p.postMessage({ type: CONTENT_TO_BG.TRANSLATE, requestId, text });
},
@@ -587,14 +584,6 @@
portClient.translate(selection.text);
}
- /**
- * Request a translation for an arbitrary source text (regenerate).
- * @param {string} sourceText
- */
- function requestTranslation(sourceText) {
- portClient.translate(sourceText);
- }
-
// ---------------------------------------------------------------------
// Enabled state (storage.local, EN-01/EN-02)
// ---------------------------------------------------------------------