fix(webui): clicking an inactive compare pane only activates it

Previously clicking a non-active video pane both switched the active
version and toggled playback. Now a click on an inactive pane only makes
it active; play/pause is only toggled when clicking the already-active
pane.
This commit is contained in:
yiling
2026-07-04 10:56:55 +08:00
parent e2d4944060
commit 78c8a56183
@@ -407,9 +407,13 @@ export const CompareVideoPane = forwardRef<ComparePaneHandle, CompareVideoPanePr
const handleAreaClick = useCallback(() => {
if (useAnnotationStore.getState().isDrawing) return
onActivate?.()
// Clicking an inactive pane only activates it; playback is untouched.
if (!isActive) {
onActivate?.()
return
}
onRequestTogglePlay?.()
}, [onActivate, onRequestTogglePlay])
}, [isActive, onActivate, onRequestTogglePlay])
if (!file.media?.original?.downloadUrl || !metadata) {
return (