fix(tts): add missing ttsProvider dependency to useCallback hooks

This commit is contained in:
Richard Roberson 2025-11-09 16:43:13 -07:00
parent dad1dfd26f
commit 62853efb3c
5 changed files with 5 additions and 4 deletions

View file

@ -20,6 +20,7 @@ RUN pnpm install --frozen-lockfile
COPY . . COPY . .
# Build the Next.js application # Build the Next.js application
RUN pnpm exec next telemetry disable
RUN pnpm run build RUN pnpm run build
# Expose the port the app runs on # Expose the port the app runs on

View file

@ -329,7 +329,7 @@ export function EPUBProvider({ children }: { children: ReactNode }) {
console.error('Error creating audiobook:', error); console.error('Error creating audiobook:', error);
throw error; throw error;
} }
}, [extractBookText, apiKey, baseUrl, voice, voiceSpeed]); }, [extractBookText, apiKey, baseUrl, voice, voiceSpeed, ttsProvider]);
const setRendition = useCallback((rendition: Rendition) => { const setRendition = useCallback((rendition: Rendition) => {
bookRef.current = rendition.book; bookRef.current = rendition.book;

View file

@ -147,7 +147,7 @@ export function HTMLProvider({ children }: { children: ReactNode }) {
console.error('Error creating audiobook:', error); console.error('Error creating audiobook:', error);
throw error; throw error;
} }
}, [currDocText, currDocName, apiKey, baseUrl, voice, voiceSpeed]); }, [currDocText, currDocName, apiKey, baseUrl, voice, voiceSpeed, ttsProvider]);
const contextValue = useMemo(() => ({ const contextValue = useMemo(() => ({
currDocData, currDocData,

View file

@ -309,7 +309,7 @@ export function PDFProvider({ children }: { children: ReactNode }) {
console.error('Error creating audiobook:', error); console.error('Error creating audiobook:', error);
throw error; throw error;
} }
}, [pdfDocument, headerMargin, footerMargin, leftMargin, rightMargin, apiKey, baseUrl, voice, voiceSpeed]); }, [pdfDocument, headerMargin, footerMargin, leftMargin, rightMargin, apiKey, baseUrl, voice, voiceSpeed, ttsProvider]);
/** /**
* Effect hook to initialize TTS as non-EPUB mode * Effect hook to initialize TTS as non-EPUB mode

View file

@ -500,7 +500,7 @@ export function TTSProvider({ children }: { children: ReactNode }): ReactElement
}); });
throw error; throw error;
} }
}, [voice, speed, ttsModel, ttsInstructions, audioCache, openApiKey, openApiBaseUrl]); }, [voice, speed, ttsModel, ttsInstructions, audioCache, openApiKey, openApiBaseUrl, configTTSProvider]);
/** /**
* Processes and plays the current sentence * Processes and plays the current sentence