diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-07-08 10:11:17 +0000 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-07-08 10:11:17 +0000 |
| commit | eea002e6f5e3da4c4415d45cffd9cff64fd6c052 (patch) | |
| tree | 9da38b1dc0af8946f32c8d7e10d3f240f73de93a /src/components/user_avatar/user_avatar.js | |
| parent | 7206fee4372eba5bb05db9eb90100aee95003962 (diff) | |
streamline profile image api, update reset ui for all profile images to match avatar, remove unnecessary stuff
Diffstat (limited to 'src/components/user_avatar/user_avatar.js')
| -rw-r--r-- | src/components/user_avatar/user_avatar.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js index 4adf8211..94653004 100644 --- a/src/components/user_avatar/user_avatar.js +++ b/src/components/user_avatar/user_avatar.js @@ -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 - } } } |
