streamline profile image api, update reset ui for all profile images to match avatar, remove unnecessary stuff
This commit is contained in:
parent
7206fee437
commit
eea002e6f5
10 changed files with 153 additions and 76 deletions
|
@ -8,26 +8,20 @@ const UserAvatar = {
|
|||
],
|
||||
data () {
|
||||
return {
|
||||
showPlaceholder: false
|
||||
showPlaceholder: false,
|
||||
defaultAvatar: `${this.$store.state.instance.server + this.$store.state.instance.defaultAvatar}`
|
||||
}
|
||||
},
|
||||
components: {
|
||||
StillImage
|
||||
},
|
||||
computed: {
|
||||
imgSrc () {
|
||||
return this.showPlaceholder ? '/images/avi.png' : this.user.profile_image_url_original
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
imgSrc (src) {
|
||||
return (!src || this.showPlaceholder) ? this.defaultAvatar : src
|
||||
},
|
||||
imageLoadError () {
|
||||
this.showPlaceholder = true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
src () {
|
||||
this.showPlaceholder = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue