From 17e8ab6793c206f2e9e0dff93d3c0610bf062fcf Mon Sep 17 00:00:00 2001 From: dragongoose Date: Sun, 13 Aug 2023 10:55:41 -0400 Subject: [PATCH] Fix Infinite scroll being in english --- src/views/HomepageView.vue | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/views/HomepageView.vue b/src/views/HomepageView.vue index ec4885b..d2b247a 100644 --- a/src/views/HomepageView.vue +++ b/src/views/HomepageView.vue @@ -56,17 +56,9 @@ export default { if (bottomOfWindow && this.data) { const cursor = this.data[this.data.length - 1].cursor if (!cursor) return - const res = await fetch( - `${this.protocol}${ - import.meta.env.SAFETWITCH_BACKEND_DOMAIN - }/api/discover?cursor=${cursor}` - ) - if (!res.ok) { - throw new Error('Failed to fetch data') - } - const resData = await res.json() + const res = await getEndpoint('api/discover?cursor=' + cursor) - for (let category of resData.data) { + for (let category of res) { this.data.push(category) } }