odota / web

React web interface for the OpenDota platform
https://www.opendota.com
MIT License
1.07k stars 390 forks source link

feat(issue-3133): include logged in user scenario #3156

Closed jeyren95 closed 4 months ago

jeyren95 commented 4 months ago

Player profile is public if:

  1. Player is a pro player
  2. Player's match history is not disabled (i.e. "fh_unavailable" is false)
  3. Player's match history is disabled, but the player is logged in and is viewing own profile

Player profile is private for all other scenarios. It is much easier to just check if the player profile is public, since there seems to be fewer + less complicated scenarios

Do let me know if I have missed out on any scenarios!

image ^ this is how it will look like if we don't hide the W/L stat

howardchung commented 4 months ago

This seems fine. Although it's probably cleaner to return the visibility from the backend so we're not implementing this logic twice.