toggle boolean with if statement
Value flipping is traditionally just done with a negation:
this.showAllOnlineFriends = !this.showAllOnlineFriends

That is a common, good practice way to do it. It is highly recognizable and easy to understand