only show current lag when online

pull/3221/head
Thibault Duplessis 2017-07-05 10:11:25 +02:00
parent 00a74806ac
commit afbe041395
2 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ object User extends LilaController {
crosstable <- ctx.userId ?? { Env.game.crosstableApi(user.id, _) }
followable <- ctx.isAuth ?? { Env.pref.api.followable(user.id) }
relation <- ctx.userId ?? { relationApi.fetchRelation(_, user.id) }
ping = UserLagCache.getLagRating(user.id)
ping = env.isOnline(user.id) ?? UserLagCache.getLagRating(user.id)
res <- negotiate(
html = !ctx.is(user) ?? GameRepo.lastPlayedPlaying(user) map { pov =>
Ok(html.user.mini(user, pov, blocked, followable, relation, ping, crosstable))

View File

@ -274,8 +274,8 @@ trait UserHelper { self: I18nHelper with StringHelper with NumberHelper =>
val patronIconChar = ""
val lineIconChar = ""
val lineIcon: String = s"""<i class="line"></i>"""
val patronIcon: String = s"""<i class="line patron" title="lichess Patron"></i>"""
val lineIcon: String = """<i class="line"></i>"""
val patronIcon: String = """<i class="line patron" title="lichess Patron"></i>"""
private def lineIcon(patron: Boolean): String = if (patron) patronIcon else lineIcon
private def lineIcon(user: Option[LightUser]): String = lineIcon(user.??(_.isPatron))
def lineIcon(user: User): String = lineIcon(user.isPatron)