forked from AkkomaGang/akkoma-fe
Display user timeline
This commit is contained in:
parent
090148ef60
commit
2e7029b670
3 changed files with 12 additions and 6 deletions
|
@ -1,13 +1,15 @@
|
||||||
import UserCardContent from '../user_card_content/user_card_content.vue'
|
import UserCardContent from '../user_card_content/user_card_content.vue'
|
||||||
|
import Timeline from '../timeline/timeline.vue'
|
||||||
|
|
||||||
const UserProfile = {
|
const UserProfile = {
|
||||||
created () {
|
created () {
|
||||||
this.$store.dispatch('startFetching', ['user', this.userId])
|
this.$store.dispatch('startFetching', ['user', this.userId])
|
||||||
},
|
},
|
||||||
destroyed () {
|
destroyed () {
|
||||||
this.$store.dispatch('stopFetching', ['user', this.userId])
|
this.$store.dispatch('stopFetching', 'user')
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
timeline () { return this.$store.state.statuses.timelines.user },
|
||||||
userId () {
|
userId () {
|
||||||
return this.$route.params.id
|
return this.$route.params.id
|
||||||
},
|
},
|
||||||
|
@ -16,7 +18,8 @@ const UserProfile = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
UserCardContent
|
UserCardContent,
|
||||||
|
Timeline
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<div v-if="user" class="user-profile panel panel-default base00-background">
|
<div v-if="user" class="user-profile panel panel-default base00-background">
|
||||||
<user-card-content :user="user"></user-card-content>
|
<user-card-content :user="user"></user-card-content>
|
||||||
</div>
|
</div>
|
||||||
|
<Timeline :title="'User Timeline'" v-bind:timeline="timeline" v-bind:timeline-name="'user'"/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./user_profile.js"></script>
|
<script src="./user_profile.js"></script>
|
||||||
|
|
|
@ -113,11 +113,11 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
|
||||||
let params = []
|
let params = []
|
||||||
|
|
||||||
if (since) {
|
if (since) {
|
||||||
params.push('since_id', since)
|
params.push(['since_id', since])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (until) {
|
if (until) {
|
||||||
params.push('max_id', until)
|
params.push(['max_id', until])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userId) {
|
if (userId) {
|
||||||
|
|
Loading…
Reference in a new issue