fix(tts): sync default rate changes from settings without refresh

This commit is contained in:
Gigi
2025-10-20 22:11:21 +02:00
parent 2283f4ec08
commit e2d0bc2acf

View File

@@ -49,6 +49,13 @@ export function useTextToSpeech(options: UseTTSOptions = {}): UseTTS {
const utteranceRef = useRef<SpeechSynthesisUtterance | null>(null)
// Update rate when defaultRate option changes
useEffect(() => {
if (options.defaultRate !== undefined) {
setRate(options.defaultRate)
}
}, [options.defaultRate])
// Load voices (async in many browsers)
useEffect(() => {
if (!supported) return