diff --git a/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx b/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx index b40692f6a87..efc2e7e25d4 100644 --- a/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx +++ b/public/app/core/components/ForgottenPassword/ForgottenPassword.tsx @@ -1,5 +1,6 @@ import { css } from '@emotion/css'; import { useState } from 'react'; +import { flushSync } from 'react-dom'; import { useForm } from 'react-hook-form'; import { GrafanaTheme2 } from '@grafana/data'; @@ -34,7 +35,10 @@ export const ForgottenPassword = () => { const sendEmail = async (formModel: EmailDTO) => { const res = await getBackendSrv().post('/api/user/password/send-reset-email', formModel); if (res) { - setEmailSent(true); + // TODO why? + flushSync(() => { + setEmailSent(true); + }); } };