From 1614bf46bcb1f6434f73a4ae5accc989f852c42d Mon Sep 17 00:00:00 2001 From: Richard Roberson Date: Sun, 9 Nov 2025 16:43:13 -0700 Subject: [PATCH] fix(tts): add missing ttsProvider dependency to useCallback hooks --- Dockerfile | 1 + src/contexts/EPUBContext.tsx | 2 +- src/contexts/HTMLContext.tsx | 2 +- src/contexts/PDFContext.tsx | 2 +- src/contexts/TTSContext.tsx | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6a59f4..57f41ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN pnpm install --frozen-lockfile COPY . . # Build the Next.js application +RUN pnpm exec next telemetry disable RUN pnpm run build # Expose the port the app runs on diff --git a/src/contexts/EPUBContext.tsx b/src/contexts/EPUBContext.tsx index 39074c7..0d18c7e 100644 --- a/src/contexts/EPUBContext.tsx +++ b/src/contexts/EPUBContext.tsx @@ -329,7 +329,7 @@ export function EPUBProvider({ children }: { children: ReactNode }) { console.error('Error creating audiobook:', error); throw error; } - }, [extractBookText, apiKey, baseUrl, voice, voiceSpeed]); + }, [extractBookText, apiKey, baseUrl, voice, voiceSpeed, ttsProvider]); const setRendition = useCallback((rendition: Rendition) => { bookRef.current = rendition.book; diff --git a/src/contexts/HTMLContext.tsx b/src/contexts/HTMLContext.tsx index 16b69ac..a090e9d 100644 --- a/src/contexts/HTMLContext.tsx +++ b/src/contexts/HTMLContext.tsx @@ -147,7 +147,7 @@ export function HTMLProvider({ children }: { children: ReactNode }) { console.error('Error creating audiobook:', error); throw error; } - }, [currDocText, currDocName, apiKey, baseUrl, voice, voiceSpeed]); + }, [currDocText, currDocName, apiKey, baseUrl, voice, voiceSpeed, ttsProvider]); const contextValue = useMemo(() => ({ currDocData, diff --git a/src/contexts/PDFContext.tsx b/src/contexts/PDFContext.tsx index 9d01591..0cd81f2 100644 --- a/src/contexts/PDFContext.tsx +++ b/src/contexts/PDFContext.tsx @@ -309,7 +309,7 @@ export function PDFProvider({ children }: { children: ReactNode }) { console.error('Error creating audiobook:', 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 diff --git a/src/contexts/TTSContext.tsx b/src/contexts/TTSContext.tsx index 24eaa6c..5e659f8 100644 --- a/src/contexts/TTSContext.tsx +++ b/src/contexts/TTSContext.tsx @@ -500,7 +500,7 @@ export function TTSProvider({ children }: { children: ReactNode }): ReactElement }); throw error; } - }, [voice, speed, ttsModel, ttsInstructions, audioCache, openApiKey, openApiBaseUrl]); + }, [voice, speed, ttsModel, ttsInstructions, audioCache, openApiKey, openApiBaseUrl, configTTSProvider]); /** * Processes and plays the current sentence