From 62b9105e8046ae8db8b65e62952b6d9a83c07478 Mon Sep 17 00:00:00 2001 From: Matt Gabrenya Date: Fri, 8 Sep 2023 15:10:01 -0700 Subject: [PATCH 1/2] fix(ui): infinite scroll of followers / creators lists --- ui/src/components/BaseAgentProfileList.vue | 1 - ui/src/components/CreatorsListDialog.vue | 17 +++++++++-------- ui/src/components/FollowersListDialog.vue | 21 +++++++++++---------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ui/src/components/BaseAgentProfileList.vue b/ui/src/components/BaseAgentProfileList.vue index ef417bcd..f2bd40b4 100644 --- a/ui/src/components/BaseAgentProfileList.vue +++ b/ui/src/components/BaseAgentProfileList.vue @@ -14,7 +14,6 @@ v-else v-slot="{ item }" v-bind="$attrs" - class="my-8" :items="agentProfiles" :is-loading="loading" > diff --git a/ui/src/components/CreatorsListDialog.vue b/ui/src/components/CreatorsListDialog.vue index 8324735e..eca1977a 100644 --- a/ui/src/components/CreatorsListDialog.vue +++ b/ui/src/components/CreatorsListDialog.vue @@ -17,13 +17,14 @@ " @load-next="fetchNextPageInfiniteScroll" > - + - + { +const fetchFollowers = async (params: any) => { const agents: AgentPubKey[] = await await client.callZome({ role_name: "mewsfeed", zome_name: "follows", @@ -99,12 +100,12 @@ const { data, error, fetchNextPage, hasNextPage, isInitialLoading } = "get_followers_for_creator", encodeHashToBase64(props.agentPubKey), ], - queryFn: fetchCreators, + queryFn: fetchFollowers, getNextPageParam: (lastPage) => { if (lastPage.length === 0) return; if (lastPage.length < pageLimit) return; - return { after_agentpubkey: lastPage[lastPage.length - 1] }; + return { after_agentpubkey: lastPage[lastPage.length - 1].agentPubKey }; }, refetchInterval: 1000 * 60 * 2, // 2 minutes refetchOnMount: true, From 4822a46ca13e1fc7dc4a86e5d7f5dd894ed2e974 Mon Sep 17 00:00:00 2001 From: Matt Gabrenya Date: Sat, 9 Sep 2023 17:56:11 -0700 Subject: [PATCH 2/2] chore: lint --- ui/src/components/CreatorsListDialog.vue | 2 +- ui/src/components/FollowersListDialog.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/components/CreatorsListDialog.vue b/ui/src/components/CreatorsListDialog.vue index eca1977a..439902f7 100644 --- a/ui/src/components/CreatorsListDialog.vue +++ b/ui/src/components/CreatorsListDialog.vue @@ -65,7 +65,7 @@ const queryClient = useQueryClient(); const pageLimit = 10; const fetchCreators = async (params: any) => { - const agents: AgentPubKey[] = await await client.callZome({ + const agents: AgentPubKey[] = await client.callZome({ role_name: "mewsfeed", zome_name: "follows", fn_name: "get_creators_for_follower", diff --git a/ui/src/components/FollowersListDialog.vue b/ui/src/components/FollowersListDialog.vue index 9aa4e569..b6ff5593 100644 --- a/ui/src/components/FollowersListDialog.vue +++ b/ui/src/components/FollowersListDialog.vue @@ -65,7 +65,7 @@ const queryClient = useQueryClient(); const pageLimit = 10; const fetchFollowers = async (params: any) => { - const agents: AgentPubKey[] = await await client.callZome({ + const agents: AgentPubKey[] = await client.callZome({ role_name: "mewsfeed", zome_name: "follows", fn_name: "get_followers_for_creator",