Copilot commented on code in PR #4619:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4619#discussion_r4057843716


##########
web/src/pages/cluster/certs.tsx:
##########
@@ -70,7 +72,7 @@ const K8sCertsPage = () => {
         if (active) setCerts(data);
       })
       .catch((error: unknown) => {
-        if (active) message.error(getErrorMessage(error));
+        if (active) message.error(getErrorMessage(error, 
t('cert.requestFailed')));

Review Comment:
   This callback now closes over `t`, but the effect still has an empty 
dependency array. If the user switches language while `listK8sCerts()` is 
pending and it then fails, the fallback toast is rendered in the language from 
the initial render rather than the selected language. Include `t` in the effect 
dependencies (as other localized data-loading effects do) so the closure is 
refreshed when the language changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to