I am in a relationship with a girl , sex is barely successful because i have ED, i think i have PIED( ED because of over consuming porn).

My question is how do i approach this topic with the girl, because i really don't want to lose her, and i don't want to look weak in front of her.

I already spoke to her about my issue before sleeping with her and what could have caused it, that i am doing my best now to fix the issue and reverse the damage, and i hope to get better soon( i am doing nofap, exercise and trying to be more healthy). So i said, i am sharing this because i want to be honest from the beginning and the rest is up to you whether you would like to support me in my journey or not. Also i told her that i had and still going through a difficult period in my life and have depression symptoms and that also could be a reason of my ED. But i always say that it's what it is, and now i am trying to sort it out and focus all my energy towards solving the problem and not moan and complain about it.

Did i do the right thing?

She was understanding and said she would not leave me for that, she keeps asking about my progress and Sometimes she stars digging me and i think i messed up, because i opened up to her about my history regarding porn addiction and how much and frequently i used to masturbate, and start mentioning some difficult moments of my life and things i have been through.