Was this the right thing to do?

I’m a caregiver and an old friend told me there’s an opening at her job (a health agency) and I really want it. Since I work a lot for the company I’m at, I went ahead and told my manager that I am looking for another job and that I wanted to give them plenty of notice. I told my boyfriend and he acted like I did the wrong thing. Should I have waited until I have the job for sure (and only give them a 2 week notice?) here’s our text

***i should also mention even if the opening wasn’t available, I am still unhappy at my current job and would still be looking for another job even if I don’t get the job at the health agency.*****

And heres my manager and my texts