th Black
th Time control
th(v-if="showResult") Result
+ // TODO: show my games first (st.user.id or sid)
tr(v-for="g in games" @click="$emit('show-game',g)")
td {{ g.vname }}
- td {{ g.players[0] }}
- td {{ g.players[1] }}
+ td {{ g.players[0].name || "@nonymous" }}
+ td {{ g.players[1].name || "@nonymous" }}
td {{ g.timeControl }}
td(v-if="showResult") {{ g.score }}
</template>
props: ["games"],
computed: {
showResult: function() {
- return this.games.length > 0 && this.games[0].score != "*";
+ return this.games.some(g => g.score != "*");
},
},
};