Skip to content

Commit 0f3c098

Browse files
authored
Merge pull request #6522 from nextcloud/backport/6518/stable26
[stable26] fix: Detect end of the activity responses (fix #3395)
2 parents 49225a7 + f198571 commit 0f3c098

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/components/ActivityList.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,20 @@ export default {
8484
params.append('object_id', '' + this.objectId)
8585
params.append('limit', ACTIVITY_FETCH_LIMIT)
8686
87-
const response = await axios.get(generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params)
87+
const response = await axios.get(
88+
generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params,
89+
{
90+
validateStatus: (status) => {
91+
return (status >= 200 && status < 300) || status === 304
92+
},
93+
},
94+
)
95+
96+
if (response.status === 304) {
97+
this.endReached = true
98+
return []
99+
}
100+
88101
let activities = response.data.ocs.data
89102
if (this.filter === 'deck') {
90103
// We need to manually filter activities here, since currently we use two different types and there is no way
@@ -95,7 +108,7 @@ export default {
95108
})
96109
}
97110
this.activities.push(...activities)
98-
if (response.data.ocs.meta.statuscode === 304 || activities.length === 0) {
111+
if (activities.length === 0) {
99112
this.endReached = true
100113
return []
101114
}

0 commit comments

Comments
 (0)