logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

user_avatar.js (766B)


  1. import StillImage from '../still-image/still-image.vue'
  2. import { library } from '@fortawesome/fontawesome-svg-core'
  3. import {
  4. faRobot,
  5. faPeopleGroup
  6. } from '@fortawesome/free-solid-svg-icons'
  7. library.add(
  8. faRobot,
  9. faPeopleGroup
  10. )
  11. const UserAvatar = {
  12. props: [
  13. 'user',
  14. 'betterShadow',
  15. 'compact',
  16. 'showActorTypeIndicator'
  17. ],
  18. data () {
  19. return {
  20. showPlaceholder: false,
  21. defaultAvatar: `${this.$store.state.instance.server + this.$store.state.instance.defaultAvatar}`
  22. }
  23. },
  24. components: {
  25. StillImage
  26. },
  27. methods: {
  28. imgSrc (src) {
  29. return (!src || this.showPlaceholder) ? this.defaultAvatar : src
  30. },
  31. imageLoadError () {
  32. this.showPlaceholder = true
  33. }
  34. }
  35. }
  36. export default UserAvatar