Unsure why I’m getting wrection issues. Thoughts?

4 months out of 3 year relationship. I have had some major abdominal surgeries in my life and a few years ago would sporadically take viagra to help with going more rounds as I noticed some erectile issues with getting and staying hard. I take 1mg of finasteride daily for hair loss. Recently. I had 1 night with a girl 6 weeks ago and took v, we slept naked so anytime I was awake I was hard. Then met another girl 4 weeks ago and first night had sex 3-4 times with v. I was not super attracted to this girl but the sex was fun, but we’ve met two more times since and after the first round struggle to get hard and turned on…I know I’m not attracted to her and think it was a rebound play. Both of the girls loved the sex. But now I’m stuck in my head about if I’m erectile issues worse than I was before where v seemed to help. Now even when I masturbate I struggle to get a hard erection and not sure if it’s mental or finasteride or what’s going on. I went on a date with a girl last night, we hit it off and made out a few times through the night, both very aroused. And I knew I was turned on but I don’t think I got a solid erection while making out with her… Is this a mental thing that’s been building up from experience with the other girl that’s playing on my mind? Or is it finasteride? Unsure if it’s linked to ky confidence of not getting hard last time and maybe I need a good experience to switch back to normal or if it’s actually something mechanical from finasteride or just generally and the timing just links up with being with the girl I wasn’t as attracted to as now when when I kissed a girl I was attracted to I don’t remember getting hard but was arouse.

Any thoughts/suggestions let me know.