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:
@@ -12,13 +12,19 @@ export interface NotifAction {
|
||||
|
||||
// Structured payload that lets the Notification Center offer in-app actions even
|
||||
// after a reload (when live `action` callbacks are gone).
|
||||
export type NotifMeta = {
|
||||
export type VideoHiddenMeta = {
|
||||
kind: "video-hidden";
|
||||
videoId: string;
|
||||
title: string;
|
||||
channelId: string;
|
||||
channelName: string;
|
||||
};
|
||||
export type VideoWatchedMeta = {
|
||||
kind: "video-watched";
|
||||
videoId: string;
|
||||
title: string;
|
||||
};
|
||||
export type NotifMeta = VideoHiddenMeta | VideoWatchedMeta;
|
||||
|
||||
export interface Notification {
|
||||
id: number;
|
||||
|
||||
Reference in New Issue
Block a user