When can I have unprotected sex?

So I got my first Depo shot on Monday, March 16 (4 days ago) and I was on the third day of my period. My partner and I have both taken tests, both coming in clean 😊 I was wondering how soon it would be safe to start having unprotected sex. My doctor said two weeks but I was on my period when I got the shot. Would that affect it?