fix(tts): add missing ttsProvider dependency to useCallback hooks
Some checks failed
Build and Publish Docker Image / build (push) Has been cancelled

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

View file

@ -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

View file

@ -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;

View file

@ -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,

View file

@ -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

View file

@ -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