Improve mod browser load time

Add pages to mod browser
Still WIP
This commit is contained in:
Thoronium
2023-04-24 20:21:52 -06:00
parent 9d9bc43119
commit 3969c26a58
6 changed files with 132 additions and 24 deletions

View File

@@ -117,12 +117,10 @@ interface ModDownload {
containsExe: boolean
}
export async function getMods(mode: string) {
export async function getMods(mode: string, page: number) {
let modList: GamebananaResponse[] = []
let hadMods = true
let page = 1
while (hadMods) {
const resp = JSON.parse(
await invoke('list_submissions', {
mode,
@@ -133,13 +131,6 @@ export async function getMods(mode: string) {
if (resp.length === 0) hadMods = false
modList = [...modList, ...resp]
page++
console.log(page)
console.log(resp)
}
console.log(modList)
return formatGamebananaData(modList)
}