feat: improve messages experience (#572)
* impr: add message paginatin * impr: add message timestamps, close #569 * feat: add start chat button, close #566 * fix: frozen lockfile
This commit is contained in:
1 parent
ed960b969f
commit
7125a22252
7 files changed
+104
-30
No files matched your search
@@ -1,13 +1,17 @@
|
||||
import { client } from '$lib/lemmy.svelte.js'
|
||||
import { awaitIfServer } from '$lib/promise.svelte.js'
|
||||
|
||||
export async function load({ fetch }) {
|
||||
export async function load({ fetch, url }) {
|
||||
const page = Number(url.searchParams.get('page') || '1')
|
||||
|
||||
// TODO probably add proper paging
|
||||
const messagePromise = client({ func: fetch }).getPrivateMessages({
|
||||
limit: 50,
|
||||
page: page,
|
||||
})
|
||||
|
||||
return {
|
||||
messages: (await awaitIfServer(messagePromise)).data,
|
||||
page: page,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user