<template lang="pug">
div
- table.game-list
+ table.game-list(v-if="games.length > 0")
thead
tr
th {{ st.tr["Variant"] }}
@click="deleteGame(g,$event)"
)
| {{ g.score }}
+ p(v-else)
+ | {{ st.tr["No games found :( Send a challenge!"] }}
</template>
<script>
return res;
},
deleteGame: function(game, e) {
- if (game.score != "*") {
+ if (
+ game.score != "*" &&
+ game.players.some(p =>
+ p.sid == this.st.user.sid ||
+ p.uid == this.st.user.id
+ )
+ ) {
if (confirm(this.st.tr["Remove game?"])) {
GameStorage.remove(
game.id,
</script>
<style lang="sass" scoped>
+p
+ text-align: center
+ font-weight: bold
+
// NOTE: the style applied to <tr> element doesn't work
tr.my-turn > td
background-color: #fcd785