diff options
Diffstat (limited to 'src/components/user_finder/user_finder.js')
| -rw-r--r-- | src/components/user_finder/user_finder.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/user_finder/user_finder.js b/src/components/user_finder/user_finder.js index 03205382..abd40d51 100644 --- a/src/components/user_finder/user_finder.js +++ b/src/components/user_finder/user_finder.js @@ -1,20 +1,30 @@ const UserFinder = { data: () => ({ username: undefined, - hidden: true + hidden: true, + error: false, + loading: false }), methods: { findUser (username) { + this.loading = true this.$store.state.api.backendInteractor.externalProfile(username) .then((user) => { + this.loading = false + this.hidden = true if (!user.error) { this.$store.commit('addNewUsers', [user]) this.$router.push({name: 'user-profile', params: {id: user.id}}) + } else { + this.error = true } }) }, toggleHidden () { this.hidden = !this.hidden + }, + dismissError () { + this.error = false } } } |
