From d4a2376e12cd9a05e29bf8eb55d7388598ed1137 Mon Sep 17 00:00:00 2001 From: jasper Date: Mon, 18 Feb 2019 12:32:08 -0800 Subject: [PATCH 1/3] fix/fetch-error-when-login --- src/components/timeline/timeline.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 85e0a055..40b42d50 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -47,20 +47,7 @@ const Timeline = { UserCard }, created () { - const store = this.$store - const credentials = store.state.users.currentUser.credentials - const showImmediately = this.timeline.visibleStatuses.length === 0 - window.addEventListener('scroll', this.scrollLoad) - - timelineFetcher.fetchAndUpdate({ - store, - credentials, - timeline: this.timelineName, - showImmediately, - userId: this.userId, - tag: this.tag - }) }, mounted () { if (typeof document.hidden !== 'undefined') { From b4709515f22446b032c664e0960419ebea119098 Mon Sep 17 00:00:00 2001 From: jasper Date: Mon, 18 Feb 2019 17:15:16 -0800 Subject: [PATCH 2/3] Fix error when login --- src/components/timeline/timeline.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 40b42d50..3fc927f9 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -47,7 +47,22 @@ const Timeline = { UserCard }, created () { + const store = this.$store + const credentials = store.state.users.currentUser.credentials + const showImmediately = this.timeline.visibleStatuses.length === 0 + window.addEventListener('scroll', this.scrollLoad) + + if (typeof credentials !== 'undefined' || this.timelineName !== 'friends') { + timelineFetcher.fetchAndUpdate({ + store, + credentials, + timeline: this.timelineName, + showImmediately, + userId: this.userId, + tag: this.tag + }) + } }, mounted () { if (typeof document.hidden !== 'undefined') { From 1e43a47c3c922c4b68e0a84b74cafe6a2ea23bf1 Mon Sep 17 00:00:00 2001 From: jasper Date: Tue, 19 Feb 2019 09:42:53 -0800 Subject: [PATCH 3/3] Update: Fix fetch error when login --- src/components/timeline/timeline.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 3fc927f9..ee4ec10b 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -53,16 +53,16 @@ const Timeline = { window.addEventListener('scroll', this.scrollLoad) - if (typeof credentials !== 'undefined' || this.timelineName !== 'friends') { - timelineFetcher.fetchAndUpdate({ - store, - credentials, - timeline: this.timelineName, - showImmediately, - userId: this.userId, - tag: this.tag - }) - } + if (this.timelineName === 'friends' && !credentials) { return false } + + timelineFetcher.fetchAndUpdate({ + store, + credentials, + timeline: this.timelineName, + showImmediately, + userId: this.userId, + tag: this.tag + }) }, mounted () { if (typeof document.hidden !== 'undefined') {