Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/api/src/main/LobbyApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ final class LobbyApi(
"seeks" -> seeks.map(_.render),
"nowPlaying" -> displayedPovs.map(nowPlaying),
"nbNowPlaying" -> povs.size,
"nbMyTurn" -> povs.count(_.isMyTurn),
"counters" -> Json.obj(
"members" -> lobbySocket.counters.members,
"rounds" -> lobbySocket.counters.rounds
Expand Down
1 change: 1 addition & 0 deletions ui/lobby/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface LobbyData {
seeks: Seek[];
me?: LobbyMe;
nbNowPlaying: number;
nbMyTurn: number;
nowPlaying: NowPlaying[];
ratingMap: Record<Perf, RatingWithProvisional> | null;
counters: { members: number; rounds: number };
Expand Down
6 changes: 3 additions & 3 deletions ui/lobby/src/view/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function tab(ctrl: LobbyController, key: Tab, active: Tab, content: MaybeVNodes)

export default function (ctrl: LobbyController) {
const nbPlaying = ctrl.data.nbNowPlaying,
myTurnPovsNb = ctrl.data.nowPlaying.filter(p => p.isMyTurn).length,
nbMyTurn = ctrl.data.nbMyTurn,
active = ctrl.tab,
isBot = ctrl.me?.isBot;
return [
Expand All @@ -26,8 +26,8 @@ export default function (ctrl: LobbyController) {
isBot ? undefined : tab(ctrl, 'seeks', active, [i18n.site.correspondence]),
active === 'now_playing' || nbPlaying || isBot
? tab(ctrl, 'now_playing', active, [
...i18n.site.nbGamesInPlay.asArray(nbPlaying, nbPlaying >= 100 ? '100+' : nbPlaying.toString()),
myTurnPovsNb > 0 ? h('i.unread', myTurnPovsNb >= 9 ? '9+' : myTurnPovsNb) : null,
...i18n.site.nbGamesInPlay.asArray(nbPlaying, nbPlaying >= 100 ? '99+' : nbPlaying.toString()),
nbMyTurn > 0 ? h('i.unread', nbMyTurn >= 100 ? '99+' : nbMyTurn) : null,
])
: null,
];
Expand Down
Loading