9 tr(v-for="c in sortedChallenges" @click="$emit('click-challenge',c)")
13 td {{ c.timeControl }}
17 import { store } from "@/store";
20 name: "my-challenge-list",
21 props: ["challenges"],
28 sortedChallenges: function() {
29 // Show in order: challenges I sent, challenges I received, other challenges
30 let augmentedChalls = this.challenges.map(c => {
32 if (c.to == this.st.user.name)
34 else if (c.from.id == this.st.user.id || c.from.sid == this.st.user.sid)
36 return Object.assign({}, c, {priority: priority});
38 return augmentedChalls.sort((c1,c2) => { return c2.priority - c1.priority; });
45 // TODO: affichage bizarre sur petits écrans <=767px