diff --git a/components/PlayCanvas.tsx b/components/PlayCanvas.tsx index b49d5dd..7127a17 100644 --- a/components/PlayCanvas.tsx +++ b/components/PlayCanvas.tsx @@ -35,11 +35,11 @@ const AUDIO_WAIT_TIMEOUT_MS = 2500; function useTypewriter( text: string, resetKey: string, - opts: { targetDurationMs?: number; waitForAudio: boolean; defaultCharMs?: number } = { + opts: { targetDurationMs?: number; waitForAudio: boolean } = { waitForAudio: false, }, ): { shown: string; done: boolean; skip: () => void } { - const { targetDurationMs, waitForAudio, defaultCharMs } = opts; + const { targetDurationMs, waitForAudio } = opts; const [displayed, setDisplayed] = useState(""); const [prevKey, setPrevKey] = useState(resetKey); const timer = useRef | null>(null); @@ -71,7 +71,7 @@ function useTypewriter( const speed = targetDurationMs && text.length > 0 ? Math.max(MIN_CHAR_MS, targetDurationMs / text.length) - : (defaultCharMs ?? DEFAULT_CHAR_MS); + : DEFAULT_CHAR_MS; let i = 0; timer.current = setInterval(() => { @@ -86,7 +86,7 @@ function useTypewriter( if (timer.current) clearInterval(timer.current); timer.current = null; }; - }, [resetKey, text, targetDurationMs, waitForAudio, defaultCharMs]); + }, [resetKey, text, targetDurationMs, waitForAudio]); const skip = useCallback(() => { if (timer.current) { @@ -211,7 +211,6 @@ export function PlayCanvas({ const { shown: typedTeaser, done: teaserDone } = useTypewriter(teaserText ?? "", "teaser_reset", { waitForAudio: false, - defaultCharMs: 65, }); const [pulseActive, setPulseActive] = useState(false); @@ -527,7 +526,7 @@ export function PlayCanvas({

- 请 · 等 · 待 + 正 · 在 · 绘 · 制 · 第 · 一 · 幕

)}