fix(tts): add missing ttsProvider dependency to useCallback hooks
This commit is contained in:
parent
dad1dfd26f
commit
62853efb3c
5 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue