Skip to content

Commit

Permalink
fix: can't refresh statuses after delete a status in account/index pa…
Browse files Browse the repository at this point in the history
  • Loading branch information
zenghawtin committed Jan 20, 2024
1 parent cadf1b4 commit 3be0de5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions composables/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export function usePaginator<T, P, U = T>(
removeCachedStatus(id)

const data = items.value as mastodon.v1.Status[]

const prevItemsIndex = prevItems.value.findIndex((i: any) => i.id === id)
if (prevItemsIndex >= 0)
prevItems.value.splice(prevItemsIndex, 1)

const index = data.findIndex(s => s.id === id)
if (index >= 0)
data.splice(index, 1)
Expand Down
3 changes: 2 additions & 1 deletion pages/[[server]]/@[account]/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ if (account) {
title: () => `${t('account.posts')} | ${getDisplayName(account)} (@${account.acct})`,
})
}
const stream = $(useStreaming(client => client.user.subscribe()))
</script>

<template>
<div>
<AccountTabs />
<TimelinePaginator :paginator="paginator" :preprocess="reorderAndFilter" context="account" :account="account" />
<TimelinePaginator :paginator="paginator" :preprocess="reorderAndFilter" context="account" :account="account" :stream="stream" />
</div>
</template>

0 comments on commit 3be0de5

Please sign in to comment.