Skip to content

Commit

Permalink
rename isUserPlaying that is not about the user being shown, but the …
Browse files Browse the repository at this point in the history
…one being logged, aka me
  • Loading branch information
ornicar committed Oct 24, 2024
1 parent 4030f2c commit 8426a85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/controllers/User.scala
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ final class User(
ctx.userId.soFu(env.game.crosstableApi(user.id, _)),
ctx.isAuth.so(env.pref.api.followable(user.id))
).flatMapN: (blocked, crosstable, followable) =>
val ping = env.socket.isOnline.exec(user.id).so(env.socket.getLagRating(user.id))
val isUserPlaying = ctx.userId.so(env.round.playing(_))
val ping = env.socket.isOnline.exec(user.id).so(env.socket.getLagRating(user.id))
val amPlaying = ctx.userId.so(env.round.playing(_))
negotiate(
html = (ctx.isnt(user)).so(currentlyPlaying(user.user)).flatMap { pov =>
Ok.snip(
views.user.mini(user, pov, blocked, followable, relation, ping, crosstable, isUserPlaying)
views.user.mini(user, pov, blocked, followable, relation, ping, crosstable, amPlaying)
).map(_.withHeaders(CACHE_CONTROL -> "max-age=5"))
},
json =
Expand Down
4 changes: 2 additions & 2 deletions app/views/user/ui.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def mini(
relation: Option[lila.relation.Relation],
ping: Option[Int],
ct: Option[lila.game.Crosstable],
isUserPlaying: Boolean
amPlaying: Boolean
)(using ctx: Context) =
val rel = views.relation.mini(u.id, blocked, followable, relation)
def crosstable(myId: UserId) = ct
Expand All @@ -42,7 +42,7 @@ def mini(
!ctx.pref.hideRatingsInGame ||
playingGame.match
case Some(pov) => !pov.game.playable || !ctx.userId.exists(pov.game.userIds.has)
case None => !isUserPlaying
case None => !amPlaying
show.ui.mini(u, playing, blocked, followable, ping, rel, crosstable, flag, perfs, userMarks, showRating)

val perfStat = lila.perfStat.PerfStatUi(helpers)(views.user.bits.communityMenu("ratings"))
Expand Down

0 comments on commit 8426a85

Please sign in to comment.