logo

pleroma-fe

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

remote_user_resolver.js (769B)


  1. const RemoteUserResolver = {
  2. data: () => ({
  3. error: false
  4. }),
  5. mounted () {
  6. this.redirect()
  7. },
  8. methods: {
  9. redirect () {
  10. const acct = this.$route.params.username + '@' + this.$route.params.hostname
  11. this.$store.state.api.backendInteractor.fetchUser({ id: acct })
  12. .then((externalUser) => {
  13. if (externalUser.error) {
  14. this.error = true
  15. } else {
  16. this.$store.commit('addNewUsers', [externalUser])
  17. const id = externalUser.id
  18. this.$router.replace({
  19. name: 'external-user-profile',
  20. params: { id }
  21. })
  22. }
  23. })
  24. .catch(() => {
  25. this.error = true
  26. })
  27. }
  28. }
  29. }
  30. export default RemoteUserResolver