Can jobs fire you for things you did while manic in the past? What if you have hospital paperwork?

Like, say for example, you found out you had BP1 with psychosis, but you learned that by being hospitalized after posting some extremely disturbing things on professional social media (really disturbing, inflammatory, and pornographic statements).  


I ask because I'm terrified at my new job. I'm afraid HR will bring up screenshots and I won't know what to say. Co-workers could reasonably claim that they don't feel comfortable working with me, and I wouldn't know what to say other than "That's not really me".

My only hope is that "history of having a disability" in ADA covers things that were said due to that disability as well.