X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FChallengeList.vue;h=a350c705b2fb88c3c9aa337a8ff5c65373ab261e;hb=cc00b83cd8e91a3defa99acc95ee8bc7e6c8a819;hp=92c42f7c30d334eac44c929f7ca648d4b6e9b80e;hpb=6808d7a16ec1e761c6a2dffec2281c96953e4d89;p=vchess.git diff --git a/client/src/components/ChallengeList.vue b/client/src/components/ChallengeList.vue index 92c42f7c..a350c705 100644 --- a/client/src/components/ChallengeList.vue +++ b/client/src/components/ChallengeList.vue @@ -4,12 +4,16 @@ div thead tr th {{ st.tr["Variant"] }} - th {{ st.tr["From"] }} + th {{ st.tr["With"] }} th {{ st.tr["Cadence"] }} tbody - tr(v-for="c in sortedChallenges" :class="{toyou:c.priority==1,fromyou:c.priority==2}" @click="$emit('click-challenge',c)") + tr( + v-for="c in sortedChallenges" + :class="{toyou:c.priority==1,fromyou:c.priority==2}" + @click="$emit('click-challenge',c)" + ) td {{ c.vname }} - td {{ c.from.name || "@nonymous" }} + td {{ withWho(c) }} td {{ c.cadence }} @@ -42,12 +46,19 @@ export default { return c2.priority - c1.priority + (c2.added - c1.added) / deltaAdded; }); } + }, + methods: { + withWho: function(c) { + if (c.from.sid == this.st.user.sid || c.from.id == this.st.user.id) + return c.to || this.st.tr["Any player"]; + return c.from.name || "@nonymous"; + } } };