You should've left when she hooked up with him the first time. She wasn't ready to be in a relationship with you.

And you should leave her now. She's not ready to be in a relationship with you, whether she's banging her ex or not (spoiler alert she is).