feat(notifications): notify on 'watched' with an Unwatch action
Mirror the hide flow for watched: marking a video watched (card, modal toggle, or auto-watch) raises a toast and a bell-history entry with an Unwatch action — no Find-in-feed, just revert. NotifMeta becomes a discriminated union (video-hidden | video-watched); unhide/unwatch share one revert-to-new helper.
This commit is contained in:
parent
ea2e1fb5a7
commit
1a704a2de4
3 changed files with 32 additions and 7 deletions
|
|
@ -87,6 +87,13 @@ export default function Feed({
|
|||
channelName: v?.channel_title ?? "",
|
||||
},
|
||||
});
|
||||
} else if (status === "watched") {
|
||||
const v = (query.data?.pages ?? []).flatMap((p) => p.items).find((x) => x.id === id);
|
||||
notify({
|
||||
message: v?.title ? `Marked watched “${v.title}”` : "Marked watched",
|
||||
action: { label: "Unwatch", onClick: () => onState(id, "new") },
|
||||
meta: { kind: "video-watched", videoId: id, title: v?.title ?? "this video" },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue