Merge branch 'fix/prevent-repeated-fetching' into 'develop'

#485 Prevent repeated fetching

Closes #485

See merge request pleroma/pleroma-fe!738
This commit is contained in:
Shpuld Shpludson 2019-04-09 18:05:46 +00:00
commit b3ace226fb
2 changed files with 8 additions and 4 deletions

View file

@ -31,15 +31,19 @@ const LoginForm = {
username: this.user.username, username: this.user.username,
password: this.user.password password: this.user.password
} }
).then((result) => { ).then(async (result) => {
if (result.error) { if (result.error) {
this.authError = result.error this.authError = result.error
this.user.password = '' this.user.password = ''
return return
} }
this.$store.commit('setToken', result.access_token) this.$store.commit('setToken', result.access_token)
this.$store.dispatch('loginUser', result.access_token) try {
await this.$store.dispatch('loginUser', result.access_token)
this.$router.push({name: 'friends'}) this.$router.push({name: 'friends'})
} catch (e) {
console.log(e)
}
}) })
}) })
}, },

View file

@ -52,7 +52,7 @@ const Timeline = {
window.addEventListener('scroll', this.scrollLoad) window.addEventListener('scroll', this.scrollLoad)
if (this.timelineName === 'friends' && !credentials) { return false } if (store.state.api.fetchers[this.timelineName]) { return false }
timelineFetcher.fetchAndUpdate({ timelineFetcher.fetchAndUpdate({
store, store,