Merge pull request #26799 from overleaf/rh-resolve-deleted-email

Clear loading state after deleting email address

GitOrigin-RevId: 7422a7e223ba430459afa862f10c2b2fd9038306
This commit is contained in:
roo hutton
2025-07-03 13:09:19 +01:00
committed by Copybot
parent ad6f27753e
commit ef227c1d45

View File

@@ -37,7 +37,7 @@ type RemoveProps = {
function Remove({ userEmailData, deleteEmailAsync }: RemoveProps) {
const { t } = useTranslation()
const { state, deleteEmail, resetLeaversSurveyExpiration } =
const { state, deleteEmail, resetLeaversSurveyExpiration, setLoading } =
useUserEmailsContext()
const isManaged = getMeta('ol-isManagedAccount')
@@ -62,8 +62,12 @@ function Remove({ userEmailData, deleteEmailAsync }: RemoveProps) {
.then(() => {
deleteEmail(userEmailData.email)
resetLeaversSurveyExpiration(userEmailData)
// Reset the global loading state before this row is unmounted
setLoading(false)
})
.catch(() => {
setLoading(false)
})
.catch(() => {})
}
if (deleteEmailAsync.isLoading) {