From e35db024c3b5a3634a054ded2ea62ad669ba09c9 Mon Sep 17 00:00:00 2001 From: KatKatKateryna Date: Wed, 13 Oct 2021 01:05:37 +0200 Subject: [PATCH] Avatars still don't load, but no errors --- .../src/components/ListItemCommit.vue | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/packages/frontend/src/components/ListItemCommit.vue b/packages/frontend/src/components/ListItemCommit.vue index 4deeea37c..f8cffb45a 100644 --- a/packages/frontend/src/components/ListItemCommit.vue +++ b/packages/frontend/src/components/ListItemCommit.vue @@ -52,7 +52,7 @@ v-for="user in receivedUsersUnique.slice(0, 4)" :id="user" :key="user" - :avatar="userAvatar" + :avatar="user.userId" :size="30" :name="user.userId" :show-hover="false" @@ -85,16 +85,16 @@ max-width="400" :fullscreen="$vuetify.breakpoint.xsOnly" > - + Full commit activity - + data.user, variables() { return { - userId: this.receivedUsersUnique[0] /////////////fake code + userId: this.currentId } }, skip() { - if (!this.receivedUsersUnique[0] ) return true /////////////fake code + if (!this.currentId ) return true return false } } @@ -192,7 +193,9 @@ export default { showAllActivityDialog: false, userData: null, - userAvatar: null + userAvatars: [], + idUnique: [], + currentId: null } }, computed: { @@ -212,22 +215,31 @@ export default { }, watch: { activity(val) { - //console.log(val.items) let set = new Set() - if (val.items && val.items.length>0) { + if ( val && val.items && val.items.length>0) { val.items.forEach((item) => set.add(item.userId)) this.receivedUsersUnique = Array.from(set) this.receivedUsersAll = val.items + + this.receivedUsersUnique.forEach(obj => { + if (obj) { + this.idUnique.push(obj), this.currentId = obj, console.log("loop in progress")//, console.log(val) + } + }) } }, userData(val) { - this.userAvatar = val.avatar - //console.log(this.userAvatar) + console.log("query was called") + this.userAvatars.push(val.avatar) } }, methods: { goToBranch() { this.$router.push(this.branchUrl) + }, + callApollo() { + console.log(this.currentId) + this.currentId = this.currentId } } }