fix: can't refresh statuses after delete a status in account/index page, #2546

pull/2547/head
zenghawtin 2024-01-20 21:48:50 +08:00
rodzic cadf1b4a7c
commit f43317fd94
2 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -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)

Wyświetl plik

@ -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>