Skip to content

Commit

Permalink
Revert "fix: can't refresh statuses after delete a status in account/…
Browse files Browse the repository at this point in the history
…index page, elk-zone#2546"

This reverts commit 96fa823.
  • Loading branch information
zenghawtin committed Jan 7, 2024
1 parent ab03f28 commit 92c1c95
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions composables/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export function usePaginator<T, P, U = T>(
// called `next` method will mutate the internal state of the variable,
// and we need its initial state after HMR
// so clone it

const paginator = _paginator.clone()

const state = ref<PaginatorState>(isHydrated.value ? 'idle' : 'loading')
Expand Down Expand Up @@ -58,11 +57,6 @@ 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: 1 addition & 2 deletions pages/[[server]]/@[account]/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ if (account) {
title: () => `${t('account.posts')} | ${getDisplayName(account)} (@${account.acct})`,
})
}
const stream = $(useStreaming(client => client.v1.stream.streamUser()))
</script>

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

0 comments on commit 92c1c95

Please sign in to comment.