fix: review round 2 — Clear watch progress clears only the resume point, big view focus by the way it arrived, dialog name, reason tooltip, backfill locks
This commit is contained in:
@@ -3,12 +3,12 @@ import { useLatest, useStableCallback } from "../../lib/useLatest";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { qk } from "../../lib/queryKeys";
|
||||
import { isResettable } from "../../lib/api/feed";
|
||||
import { hasResumePoint } from "../../lib/api/feed";
|
||||
import {
|
||||
addPlaylistItem,
|
||||
movePlaylistItem,
|
||||
removePlaylistItem,
|
||||
resetVideoState,
|
||||
clearVideoProgress,
|
||||
writeVideoState,
|
||||
} from "../../features/video/videoWrites";
|
||||
import {
|
||||
@@ -685,14 +685,14 @@ function PlaylistDetail() {
|
||||
return write;
|
||||
}
|
||||
|
||||
// Back to fresh (the video's state row and resume point both go), from the row's menu.
|
||||
function resetRow(id: string) {
|
||||
resetVideoState(qc, id)
|
||||
// The video's resume point goes (its status stays), from the row's menu.
|
||||
function clearRowProgress(id: string) {
|
||||
clearVideoProgress(qc, id)
|
||||
.then(() => {
|
||||
qc.invalidateQueries({ queryKey: qk.playlist() });
|
||||
qc.invalidateQueries({ queryKey: qk.feed(), refetchType: "none" });
|
||||
})
|
||||
.catch((e: unknown) => notifyActionError(e, msg("errors.writeFailed.videoReset")));
|
||||
.catch((e: unknown) => notifyActionError(e, msg("errors.writeFailed.videoProgress")));
|
||||
}
|
||||
|
||||
// Stable identity: PlayerModal's keydown effect depends on it, so a fresh closure
|
||||
@@ -744,13 +744,13 @@ function PlaylistDetail() {
|
||||
onSelect: () => openPlayer(ctxRow.id),
|
||||
},
|
||||
...comfortPin.item(pinVideo(ctxRow.id), raw(ctxRow.title ?? "")),
|
||||
...(isResettable(ctxRow)
|
||||
...(hasResumePoint(ctxRow)
|
||||
? [
|
||||
{
|
||||
id: "reset",
|
||||
label: t("card.resetState"),
|
||||
id: "clearProgress",
|
||||
label: t("card.clearProgress"),
|
||||
icon: <Eraser className="w-4 h-4" />,
|
||||
onSelect: () => resetRow(ctxRow.id),
|
||||
onSelect: () => clearRowProgress(ctxRow.id),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
|
||||
Reference in New Issue
Block a user