chore: Fix the loading state when updating roles twice in a row (#37438)

Fix the loading state when updating roles twice in a row.
This commit is contained in:
Ivan Vasilov authored and GitHub committed 2025-07-25 02:05:48 +08:00
1 parent 0620e2df8f
commit 29f5fde08c
1 file changed
+6 -3
@@ -90,10 +90,11 @@ export const UpdateRolesConfirmationModal = ({
})
toast.success(`Successfully updated role for ${member.username}`)
onClose(true)
return
} catch (error: any) {
toast.error(`Failed to update role: ${error.message}`)
} finally {
setSaving(false)
return toast.error(`Failed to update role: ${error.message}`)
return
}
}
@@ -130,8 +131,10 @@ export const UpdateRolesConfirmationModal = ({
toast.success(`Successfully updated role for ${member.username}`)
onClose(true)
} catch (error: any) {
toast.error(`Failed to update role: ${error.message}`)
} finally {
setSaving(false)
return toast.error(`Failed to update role: ${error.message}`)
return
}
}