fixing bug that basically caused infinite loop

This commit is contained in:
localhost 2023-09-16 11:02:00 +02:00
parent c2f81583a3
commit e66f2c5c2d
1 changed files with 2 additions and 2 deletions

View File

@ -66,9 +66,9 @@ async function getChannelVideos(id) {
const page = await (await fetch(`${instance}/nextpage/channel/${id}?nextpage=${encodeURIComponent(payload)}`)).json()
videos.push(...page.relatedStreams)
if (videos.length >= 60) resolve(videos)
if (videos.length >= 60) return resolve(videos)
if (page.nextpage) await getNextPage(page.nextpage)
else resolve(videos)
else return resolve(videos)
}
} catch (e) {