streamline profile image api, update reset ui for all profile images to match avatar, remove unnecessary stuff

This commit is contained in:
Shpuld Shpludson 2020-07-08 10:11:17 +00:00 committed by lain
parent 7206fee437
commit eea002e6f5
10 changed files with 153 additions and 76 deletions

View file

@ -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
}
}
}