Skip to content

Commit aae7088

Browse files
committed
Fixed avatar
1 parent 8c8606a commit aae7088

File tree

1 file changed

+43
-11
lines changed

1 file changed

+43
-11
lines changed

src/components/comments/CommentList.vue

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@
77
<v-list-item-avatar
88
v-if="typeof comment.userId !== 'undefined'"
99
size="50"
10-
><v-img
10+
>
11+
<v-img
12+
v-if="comment.userId.photoUrl !== 'no-photo.jpg'"
13+
class="elevation-6"
1114
:src="`${url}/uploads/avatars/${comment.userId.photoUrl}`"
12-
></v-img
13-
></v-list-item-avatar>
15+
></v-img>
16+
<v-avatar v-else color="red">
17+
<span class="white--text headline ">
18+
{{
19+
comment.userId.channelName.split('')[0].toUpperCase()
20+
}}</span
21+
>
22+
</v-avatar>
23+
</v-list-item-avatar>
1424
<v-list-item-content>
1525
<div class="d-flex mb-0">
1626
<v-list-item-title
@@ -61,11 +71,21 @@
6171
<v-avatar v-if="!isAuthenticated" color="primary">
6272
<v-icon class="white--text">mdi-account</v-icon>
6373
</v-avatar>
64-
<v-img
65-
v-else
66-
:src="`${url}/uploads/avatars/${currentUser.photoUrl}`"
67-
></v-img
68-
></v-list-item-avatar>
74+
<template v-else>
75+
<v-img
76+
v-if="currentUser.photoUrl !== 'no-photo.jpg'"
77+
class="elevation-6"
78+
:src="`${url}/uploads/avatars/${currentUser.photoUrl}`"
79+
></v-img>
80+
<v-avatar v-else color="red">
81+
<span class="white--text headline ">
82+
{{
83+
currentUser.channelName.split('')[0].toUpperCase()
84+
}}</span
85+
>
86+
</v-avatar>
87+
</template>
88+
</v-list-item-avatar>
6989
<v-list-item-content class="align-self-auto mt-0 pt-0">
7090
<v-form :ref="`form${comment._id}`">
7191
<v-text-field
@@ -122,12 +142,24 @@
122142
<v-list-item-avatar
123143
v-if="typeof reply !== 'undefined'"
124144
size="50"
125-
><v-img
145+
>
146+
<v-img
147+
v-if="reply.userId.photoUrl !== 'no-photo.jpg'"
148+
class="elevation-6"
126149
:src="
127150
`${url}/uploads/avatars/${reply.userId.photoUrl}`
128151
"
129-
></v-img
130-
></v-list-item-avatar>
152+
></v-img>
153+
<v-avatar v-else color="red">
154+
<span class="white--text headline ">
155+
{{
156+
reply.userId.channelName
157+
.split('')[0]
158+
.toUpperCase()
159+
}}</span
160+
>
161+
</v-avatar>
162+
</v-list-item-avatar>
131163
<v-list-item-content>
132164
<div class="d-flex mb-0">
133165
<v-list-item-title

0 commit comments

Comments
 (0)