8 tr(v-for="c in sortedChallenges" @click="$emit('click-challenge',c)")
12 td {{ c.timeControl }}
16 import { store } from "@/store";
19 name: "my-challenge-list",
20 props: ["challenges"],
27 sortedChallenges: function() {
28 // Show in order: challenges I sent, challenges I received, other challenges
29 let augmentedChalls = this.challenges.map(c => {
31 if (c.to == this.st.user.name)
33 else if (c.from.id == this.st.user.id || c.from.sid == this.st.user.sid)
35 return Object.assign({}, c, {priority: priority});
37 return augmentedChalls.sort((c1,c2) => { return c2.priority - c1.priority; });
44 // TODO: affichage bizarre sur petits écrans <=767px