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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user