commit: b3ace226fbb85ef33b52fa27f592068a2c8a6b8d
parent: 1e9ddcb0da433b70c4146c49f3fbeba6bd44b660
Author: Shpuld Shpludson <shp@cock.li>
Date: Tue, 9 Apr 2019 18:05:46 +0000
Merge branch 'fix/prevent-repeated-fetching' into 'develop'
#485 Prevent repeated fetching
Closes #485
See merge request pleroma/pleroma-fe!738
Diffstat:
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js
@@ -31,15 +31,19 @@ const LoginForm = {
username: this.user.username,
password: this.user.password
}
- ).then((result) => {
+ ).then(async (result) => {
if (result.error) {
this.authError = result.error
this.user.password = ''
return
}
this.$store.commit('setToken', result.access_token)
- this.$store.dispatch('loginUser', result.access_token)
- this.$router.push({name: 'friends'})
+ try {
+ await this.$store.dispatch('loginUser', result.access_token)
+ this.$router.push({name: 'friends'})
+ } catch (e) {
+ console.log(e)
+ }
})
})
},
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
@@ -52,7 +52,7 @@ const Timeline = {
window.addEventListener('scroll', this.scrollLoad)
- if (this.timelineName === 'friends' && !credentials) { return false }
+ if (store.state.api.fetchers[this.timelineName]) { return false }
timelineFetcher.fetchAndUpdate({
store,