aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/user_profile/user_profile.js6
-rw-r--r--src/components/user_profile/user_profile.vue2
-rw-r--r--src/modules/statuses.js8
-rw-r--r--src/services/timeline_fetcher/timeline_fetcher.service.js2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index 2ca09817..bde20707 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -21,7 +21,7 @@ const UserProfile = {
return this.$route.params.id || this.user.id
},
userName () {
- return this.$route.params.name
+ return this.$route.params.name || this.user.screen_name
},
friends () {
return this.user.friends
@@ -68,7 +68,7 @@ const UserProfile = {
}
this.$store.dispatch('stopFetching', 'user')
this.$store.commit('clearTimeline', { timeline: 'user' })
- this.$store.dispatch('startFetching', ['user', this.userName])
+ this.$store.dispatch('startFetching', ['user', this.fetchBy])
},
userId () {
if (!this.isExternal) {
@@ -76,7 +76,7 @@ const UserProfile = {
}
this.$store.dispatch('stopFetching', 'user')
this.$store.commit('clearTimeline', { timeline: 'user' })
- this.$store.dispatch('startFetching', ['user', this.userId])
+ this.$store.dispatch('startFetching', ['user', this.fetchBy])
},
user () {
if (this.user.id && !this.user.followers) {
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index a46befa5..50619026 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -3,7 +3,7 @@
<div v-if="user.id" class="user-profile panel panel-default">
<user-card-content :user="user" :switcher="true" :selected="timeline.viewing"></user-card-content>
<tab-switcher>
- <Timeline :label="$t('user_card.statuses')" :embedded="true" :title="$t('user_profile.timeline_title')" :timeline="timeline" :timeline-name="'user'" :user-id="userId"/>
+ <Timeline :label="$t('user_card.statuses')" :embedded="true" :title="$t('user_profile.timeline_title')" :timeline="timeline" :timeline-name="'user'" :user-id="fetchBy"/>
<div :label="$t('user_card.followees')">
<div v-if="friends">
<user-card v-for="friend in friends" :key="friend.id" :user="friend" :showFollows="true"></user-card>
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index dccccf72..f92239a9 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -2,7 +2,7 @@ import { includes, remove, slice, sortBy, toInteger, each, find, flatten, maxBy,
import apiService from '../services/api/api.service.js'
// import parse from '../services/status_parser/status_parser.js'
-const emptyTl = () => ({
+const emptyTl = (userId = 0) => ({
statuses: [],
statusesObject: {},
faves: [],
@@ -14,8 +14,8 @@ const emptyTl = () => ({
loading: false,
followers: [],
friends: [],
- userId: 0,
- flushMarker: 0
+ flushMarker: 0,
+ userId
})
export const defaultState = {
@@ -346,7 +346,7 @@ export const mutations = {
each(oldTimeline.visibleStatuses, (status) => { oldTimeline.visibleStatusesObject[status.id] = status })
},
clearTimeline (state, { timeline }) {
- state.timelines[timeline] = emptyTl()
+ state.timelines[timeline] = emptyTl(state.timelines[timeline].userId)
},
setFavorited (state, { status, value }) {
const newStatus = state.allStatusesObject[status.id]
diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js
index c2a7de56..727f6c60 100644
--- a/src/services/timeline_fetcher/timeline_fetcher.service.js
+++ b/src/services/timeline_fetcher/timeline_fetcher.service.js
@@ -31,7 +31,7 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false
return apiService.fetchTimeline(args)
.then((statuses) => {
- if (!older && statuses.length >= 20 && !timelineData.loading) {
+ if (!older && statuses.length >= 20 && !timelineData.loading && timelineData.statuses.length) {
store.dispatch('queueFlush', { timeline: timeline, id: timelineData.maxId })
}
update({store, statuses, timeline, showImmediately, userId})