fix(translator): refresh translation when provider is changed in translator popup (#1855)

– Add the translate function to the dependency array in the TranslatorPopup component
– This change ensures that the translation content is re-fetched whenever the translate function is updated

Co-authored-by: 李家豪 <7904127+li_jiahaojj@user.noreply.gitee.com>
This commit is contained in:
lijiahao66666
2025-08-20 17:54:20 +08:00
committed by GitHub
parent 8c31dc85f9
commit dc7c6e14bc
@@ -129,7 +129,7 @@ const TranslatorPopup: React.FC<TranslatorPopupProps> = ({
fetchTranslation();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [text, token, sourceLang, targetLang, provider]);
}, [text, token, sourceLang, targetLang, provider, translate]);
return (
<div>