feat: hide post
This commit is contained in:
@@ -73,6 +73,12 @@ export default function MyPostsFeedPage() {
|
||||
setFeed((rows) => rows.map((p) => (p.id === updated.id ? updated : p)));
|
||||
}
|
||||
|
||||
// Hiding a post moves it off the timeline (into the Hidden tab), so drop
|
||||
// it from this feed immediately rather than waiting for a refresh.
|
||||
function onHiddenChange(id: string, hidden: boolean) {
|
||||
if (hidden) setFeed((rows) => rows.filter((p) => p.id !== id));
|
||||
}
|
||||
|
||||
if (!user) return null;
|
||||
|
||||
return (
|
||||
@@ -90,6 +96,7 @@ export default function MyPostsFeedPage() {
|
||||
post={p}
|
||||
onDelete={(id) => setPendingDelete(id)}
|
||||
onUpdated={onPostUpdated}
|
||||
onHiddenChange={onHiddenChange}
|
||||
/>
|
||||
))
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user