MCPcopy Create free account
hub / github.com/BintzGavin/helios / commitChange

Function commitChange

packages/studio/src/components/Controls/TimecodeInput.tsx:47–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 };
46
47 const commitChange = () => {
48 try {
49 const frames = parseTimecode(text, fps);
50 onChange(frames / fps);
51 setError(false);
52 setIsEditing(false);
53 } catch (e) {
54 console.warn("Invalid timecode:", text);
55 setError(true);
56 // Don't leave edit mode on error, or revert?
57 // Reverting behavior:
58 const frame = Math.round((value || 0) * fps);
59 setText(framesToTimecode(frame, fps));
60 setIsEditing(false);
61 }
62 };
63
64 const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
65 if (e.key === 'Enter') {

Callers

nothing calls this directly

Calls 2

framesToTimecodeFunction · 0.90
parseTimecodeFunction · 0.70

Tested by

no test coverage detected