0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch.git synced 2024-12-22 13:22:58 -05:00

Fix Infinite scroll being in english

This commit is contained in:
dragongoose 2023-08-13 10:55:41 -04:00
parent 5cddb95ce8
commit 17e8ab6793
No known key found for this signature in database
GPG key ID: 01397EEC371CDAA5

View file

@ -56,17 +56,9 @@ export default {
if (bottomOfWindow && this.data) { if (bottomOfWindow && this.data) {
const cursor = this.data[this.data.length - 1].cursor const cursor = this.data[this.data.length - 1].cursor
if (!cursor) return if (!cursor) return
const res = await fetch( const res = await getEndpoint('api/discover?cursor=' + cursor)
`${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()
for (let category of resData.data) { for (let category of res) {
this.data.push(category) this.data.push(category)
} }
} }