feat: Add pagination to inbox page

This commit is contained in:
Xyphyn committed 2023-07-27 12:30:09 -07:00
1 parent c0aaf08a9f
commit 81270b72d3
4 files changed
+31 -24

No files matched your search

+5 -3
View File
@@ -2,15 +2,17 @@ import { authData, getClient } from '$lib/lemmy.js'
import { getInboxItemPublished } from '$lib/lemmy/inbox.js'
import { get } from 'svelte/store'
export async function load() {
export async function load({ url }) {
const auth = get(authData)
if (!auth) return
const client = getClient()
const page = Number(url.searchParams.get('page')) || 1
const params = {
limit: 50,
page: 1,
page: page,
auth: auth.token,
}
@@ -36,5 +38,5 @@ export async function load() {
Date.parse(getInboxItemPublished(a))
)
return { data: data }
return { page: page, data: data }
}