diff --git a/DysonNetwork.Sphere/Client/src/components/PostEditor.vue b/DysonNetwork.Sphere/Client/src/components/PostEditor.vue
index d5706d3..bff61f4 100644
--- a/DysonNetwork.Sphere/Client/src/components/PostEditor.vue
+++ b/DysonNetwork.Sphere/Client/src/components/PostEditor.vue
@@ -7,7 +7,7 @@
:custom-request="customRequest"
v-model:file-list="fileList"
>
-
+
-
+
diff --git a/DysonNetwork.Sphere/Client/src/views/index.vue b/DysonNetwork.Sphere/Client/src/views/index.vue
index cea94b9..0a25563 100644
--- a/DysonNetwork.Sphere/Client/src/views/index.vue
+++ b/DysonNetwork.Sphere/Client/src/views/index.vue
@@ -57,22 +57,21 @@ onMounted(() => fetchVersion())
const loading = ref(false)
const activites = ref([])
-const activitesLast = computed(
- () =>
- activites.value.sort(
- (a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime(),
- )[0],
-)
+const activitesLast = computed(() => activites.value[Math.max(activites.value.length - 1, 0)])
+const activitesHasMore = ref(true)
async function fetchActivites() {
if (loading.value) return
+ if (!activitesHasMore.value) return
loading.value = true
const resp = await fetch(
activitesLast.value == null
? '/api/activities'
: `/api/activities?cursor=${new Date(activitesLast.value.created_at).toISOString()}`,
)
- activites.value.push(...(await resp.json()))
+ const data = await resp.json()
+ activites.value = [...activites.value, ...data]
+ activitesHasMore.value = data[0]?.type != 'empty'
loading.value = false
}
onMounted(() => fetchActivites())