3v324v23 commited on
Commit
10a3bbb
·
1 Parent(s): 9bf89c1
Files changed (1) hide show
  1. src/pages/index.tsx +5 -1
src/pages/index.tsx CHANGED
@@ -46,7 +46,11 @@ export default function Home() {
46
  </div>)}
47
  {next ?
48
  <button onClick={async () => {
49
- const data = await (await fetch('https://huggingface.co' + next)).json() as HF_FileEntry[];
 
 
 
 
50
  setEntries([...entries, ...data]);
51
  }}>more</button> : null}
52
  </Stack>
 
46
  </div>)}
47
  {next ?
48
  <button onClick={async () => {
49
+ const res = await fetch('https://huggingface.co' + next);
50
+ if (res.headers.get('link')) {
51
+ setNext(res.headers.get('link')!.split('>;')[0].replace('<https://huggingface.co', ''))
52
+ }
53
+ const data = await (res).json() as HF_FileEntry[];
54
  setEntries([...entries, ...data]);
55
  }}>more</button> : null}
56
  </Stack>