Every time I see my babies dad I get so depressed

My babies dad comes once a month to see our 1year old since he lives 5hrs away he got a gf and everything after the baby we were just friends that slept together but we did spend most of time together we slept over at least 3 times a week and then I got pregnant and he left . He came back once the baby was born like I said once a month to see him , every time after I see him I literally get into a bad depression and cry and I don’t even know why l just do this time he was kind of flirting and talking about our past of things we would do together and then said how he use to think I was pretty and this and that and it made me so sad for some reason I don’t think I ever wanted to be with him but sleeping with someone for 3 years and having a baby obviously there is gonna be some feelings the last time we slept together was when my baby was 6 weeks old , over messages he’s always like rude but in person he acts differently but has said that I wasnt anything special just sex and ig that’s hard for me to get over especially since I went through everything alone my pregnancy birth postpartum he moved while I was pregnant so he wasn’t really involved lately he seems to be trying but idk it’s hard seeing him and thinking about all the things he’s said and done to me but Ik I have to get over everything. I guess there’s nothing I can do because we have a kid together but I just get such bad anxiety and cry so much after seeing and being around him