fix duplicate const declaration of getSelectedModel

Consolidated duplicate imports in translate-modal.js that were causing
SyntaxError: redeclaration of const getSelectedModel.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Russell Ballestrini 2025-07-11 21:42:46 -04:00
parent 04f0ac766b
commit 8dbf607c03

View file

@ -306,11 +306,9 @@ export function openTranslateModal() {
resultContainer.classList.remove("show");
// Get exact tokenization for the UI progress indicator
const { extractPageContent } = await import("./translation.js");
const { preserveSpecialContent, estimateProcessingTime } = await import("./translation.js");
const { extractPageContent, preserveSpecialContent, estimateProcessingTime, SUPPORTED_LANGUAGES } = await import("./translation.js");
const { countTokensWithUpstream } = await import("./token_estimator.js");
const { getSelectedModel } = await import("./models.js");
const { SUPPORTED_LANGUAGES } = await import("./translation.js");
const { getSelectedModel, getSelectedModelMaxTokens } = await import("./models.js");
let rawContent;
let remoteUrl; // Store URL for remote translations
@ -336,11 +334,6 @@ export function openTranslateModal() {
// Calculate actual tokens that will be sent to AI (including preservation and chunking)
let totalTokens = 0;
// Import all needed functions
const { getSelectedModelMaxTokens, getSelectedModel } = await import("./models.js");
const { countTokensWithUpstream } = await import("./token_estimator.js");
const { preserveSpecialContent, estimateProcessingTime, SUPPORTED_LANGUAGES } = await import("./translation.js");
// Simulate the same chunking logic that translateHTML will use
const maxTokens = getSelectedModelMaxTokens() || 8192;
const reserveTokens = 1000;