fix: optimize auto translation

This commit is contained in:
Bo26fhmC5M
2025-02-16 08:56:57 +09:00
parent 1562f0549f
commit 53eb087943

View File

@@ -154,9 +154,17 @@
}
}
const lastTranslated = translated
setTimeout(() => {
translated = translateText
}, 10)
// State change of `translated` triggers markParsing again,
// causing redundant translation attempts
if (lastTranslated !== translateText) {
return;
}
} catch (error) {
console.error(error)
}