Skip to content

Commit 52cb1fa

Browse files
committed
refactor: remove unused currentHash prop from CheckpointMenu
The currentHash prop was no longer being used after removing the isCurrent conditional logic. This commit removes it from the component props and type definition to clean up the API.
1 parent 5fabe1b commit 52cb1fa

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

webview-ui/src/components/chat/checkpoints/CheckpointMenu.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { Checkpoint } from "./schema"
1111
type CheckpointMenuBaseProps = {
1212
ts: number
1313
commitHash: string
14-
currentHash?: string
1514
checkpoint: Checkpoint
1615
}
1716
type CheckpointMenuControlledProps = {
@@ -24,14 +23,7 @@ type CheckpointMenuUncontrolledProps = {
2423
}
2524
type CheckpointMenuProps = CheckpointMenuBaseProps & (CheckpointMenuControlledProps | CheckpointMenuUncontrolledProps)
2625

27-
export const CheckpointMenu = ({
28-
ts,
29-
commitHash,
30-
currentHash: _currentHash,
31-
checkpoint,
32-
open,
33-
onOpenChange,
34-
}: CheckpointMenuProps) => {
26+
export const CheckpointMenu = ({ ts, commitHash, checkpoint, open, onOpenChange }: CheckpointMenuProps) => {
3527
const { t } = useTranslation()
3628
const [internalOpen, setInternalOpen] = useState(false)
3729
const [isConfirming, setIsConfirming] = useState(false)

webview-ui/src/components/chat/checkpoints/CheckpointSaved.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ type CheckpointSavedProps = {
1313
checkpoint?: Record<string, unknown>
1414
}
1515

16-
export const CheckpointSaved = ({ checkpoint, ...props }: CheckpointSavedProps) => {
16+
export const CheckpointSaved = ({ checkpoint, currentHash, ...props }: CheckpointSavedProps) => {
1717
const { t } = useTranslation()
18-
const isCurrent = props.currentHash === props.commitHash
18+
const isCurrent = currentHash === props.commitHash
1919
const [isPopoverOpen, setIsPopoverOpen] = useState(false)
2020
const [isClosing, setIsClosing] = useState(false)
2121
const closeTimer = useRef<number | null>(null)

0 commit comments

Comments
 (0)