From 55004b93093277e125d99b170095759765531f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 11 Nov 2023 20:26:14 +0100 Subject: [PATCH] fix: Detect end of the activity responses (fix #3395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/ActivityList.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/ActivityList.vue b/src/components/ActivityList.vue index 597058527..364ab2ad4 100644 --- a/src/components/ActivityList.vue +++ b/src/components/ActivityList.vue @@ -84,7 +84,20 @@ export default { params.append('object_id', '' + this.objectId) params.append('limit', ACTIVITY_FETCH_LIMIT) - const response = await axios.get(generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params) + const response = await axios.get( + generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params, + { + validateStatus: (status) => { + return (status >= 200 && status < 300) || status === 304 + }, + }, + ) + + if (response.status === 304) { + this.endReached = true + return [] + } + let activities = response.data.ocs.data if (this.filter === 'deck') { // 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 { }) } this.activities.push(...activities) - if (response.data.ocs.meta.statuscode === 304 || activities.length === 0) { + if (activities.length === 0) { this.endReached = true return [] }