
You're not the only one. I have the same issue.
When I feel or worry I am not doing great at work my self-esteem suffers. And when I feel the opposite, I feel on top of the world.
My self-esteem has very much been attached to my work. I try to tell myself: I am doing my very best, and that is all I can ask of myself.
In my head, I know that self-esteem comes from inside and that we should not attach it to anything outside ourselves. But I am guilty of attaching it to my work a lot of the time.
The only solution I have found is to deliberately try to feel good about myself when I know I have done the best job I possibly can.