Preserve params when fetching older in <Timeline>

This commit is contained in:
smitten 2023-08-07 09:00:06 -04:00
parent 031cb40904
commit 3be6281491
Signed by: smitten
GPG key ID: 1DDD22F13552A07A
3 changed files with 18 additions and 12 deletions

View file

@ -23,6 +23,7 @@ const Timeline = {
'userId', 'userId',
'listId', 'listId',
'tag', 'tag',
'fetchParams',
'embedded', 'embedded',
'count', 'count',
'pinnedStatusIds', 'pinnedStatusIds',
@ -181,7 +182,8 @@ const Timeline = {
showImmediately: true, showImmediately: true,
userId: this.userId, userId: this.userId,
listId: this.listId, listId: this.listId,
tag: this.tag tag: this.tag,
params: this.fetchParams,
}).then(({ statuses }) => { }).then(({ statuses }) => {
if (statuses && statuses.length === 0) { if (statuses && statuses.length === 0) {
this.bottomedOut = true this.bottomedOut = true

View file

@ -93,6 +93,19 @@ const UserProfile = {
hasPinned () { hasPinned () {
return !!(this.user.pinnedStatusIds || []).length return !!(this.user.pinnedStatusIds || []).length
}, },
fetchParams () {
if (this.tab !== 'statuses') {
return []
}
const params = []
if (!this.filterParams.showReplies) {
params.push(['exclude_replies', 1])
}
if (!this.filterParams.showRepeats) {
params.push(['exclude_reblogs', 1])
}
return params
},
favorites () { favorites () {
return this.$store.state.statuses.timelines.favorites return this.$store.state.statuses.timelines.favorites
}, },
@ -136,17 +149,7 @@ const UserProfile = {
if (this.isUs) timelineTabMap['favorites'] = 'favorites' if (this.isUs) timelineTabMap['favorites'] = 'favorites'
const timeline = timelineTabMap[nextTab] const timeline = timelineTabMap[nextTab]
const fetchArgs = { timeline: timeline, userId: this.userId } const fetchArgs = { timeline: timeline, userId: this.userId, params: this.fetchParams }
if (timeline === 'user') {
const params = []
if (!this.filterParams.showReplies) {
params.push(['exclude_replies', 1])
}
if (!this.filterParams.showRepeats) {
params.push(['exclude_reblogs', 1])
}
fetchArgs.params = params
}
if (timeline) { if (timeline) {
this.stopFetching() this.stopFetching()

View file

@ -92,6 +92,7 @@
:user-id="userId" :user-id="userId"
:pinned-status-ids="user.pinnedStatusIds" :pinned-status-ids="user.pinnedStatusIds"
:in-profile="true" :in-profile="true"
:fetch-params="fetchParams"
:footer-slipgate="footerRef" :footer-slipgate="footerRef"
/> />
</div> </div>