Adds Messaging streaming

This commit is contained in:
Jonathan Bourdon
2024-07-19 00:45:00 -04:00
parent 89ac0f8bc4
commit 8afa037fbe
8 changed files with 185 additions and 52 deletions

View File

@@ -37,13 +37,13 @@ const props = defineProps({
const client = useClient()
const contents = ref([])
const max_items = 10
const page_size = 10
const errorMessage = ref()
let last_id = null
async function load({done}) {
try {
let uri = `/api/contents/user/${props.creatorId}?max_items=${max_items}`
let uri = `/api/contents/user/${props.creatorId}?page_size=${page_size}`
if (last_id !== null) uri = uri + `&last_id=${last_id}`
console.log(`Fetching content at: ${uri}`)
@@ -59,7 +59,7 @@ async function load({done}) {
last_id = last_content.id
}
if (contentCount < max_items)
if (contentCount < page_size)
done('empty')
else
done('ok')