From 090148ef6051ec2399fe47281db9f73955297d97 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Mon, 12 Jun 2017 16:00:46 +0200 Subject: Start fetching user timelines. --- src/components/user_profile/user_profile.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/user_profile/user_profile.vue') diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 11a61bfc..fe693c9d 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -1,5 +1,5 @@ -- cgit v1.2.3-70-g09d2 From 2e7029b67027dae7ee3202553c0c9e288c882730 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Mon, 12 Jun 2017 16:20:02 +0200 Subject: Display user timeline --- src/components/user_profile/user_profile.js | 7 +++++-- src/components/user_profile/user_profile.vue | 7 +++++-- src/services/api/api.service.js | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/components/user_profile/user_profile.vue') diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 4f35cf27..5eef2735 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -1,13 +1,15 @@ import UserCardContent from '../user_card_content/user_card_content.vue' +import Timeline from '../timeline/timeline.vue' const UserProfile = { created () { this.$store.dispatch('startFetching', ['user', this.userId]) }, destroyed () { - this.$store.dispatch('stopFetching', ['user', this.userId]) + this.$store.dispatch('stopFetching', 'user') }, computed: { + timeline () { return this.$store.state.statuses.timelines.user }, userId () { return this.$route.params.id }, @@ -16,7 +18,8 @@ const UserProfile = { } }, components: { - UserCardContent + UserCardContent, + Timeline } } diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index fe693c9d..0765b01c 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -1,6 +1,9 @@ diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 3715a211..026dae73 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -113,11 +113,11 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use let params = [] if (since) { - params.push('since_id', since) + params.push(['since_id', since]) } if (until) { - params.push('max_id', until) + params.push(['max_id', until]) } if (userId) { -- cgit v1.2.3-70-g09d2 From 5328aca1efcdd09089bda9068efca9b940c2f6fa Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Mon, 12 Jun 2017 16:34:41 +0200 Subject: Use userId in timeline. --- src/components/timeline/timeline.js | 9 ++++++--- src/components/user_profile/user_profile.vue | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/components/user_profile/user_profile.vue') diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 7aaa81c8..3dc07f9e 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -6,7 +6,8 @@ const Timeline = { props: [ 'timeline', 'timelineName', - 'title' + 'title', + 'userId' ], computed: { timelineError () { return this.$store.state.statuses.error } @@ -26,7 +27,8 @@ const Timeline = { store, credentials, timeline: this.timelineName, - showImmediately + showImmediately, + userId: this.userId }) }, methods: { @@ -42,7 +44,8 @@ const Timeline = { credentials, timeline: this.timelineName, older: true, - showImmediately: true + showImmediately: true, + userId: this.userId }).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false })) }, scrollLoad (e) { diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 0765b01c..9241c469 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -3,7 +3,7 @@ - + -- cgit v1.2.3-70-g09d2