mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 23:02:10 +03:00
fix(api): resolve TypeError in chat/completions ensureInitialized
initTranslators() is a no-op stub (translators self-register via static imports). Wrapping the call with Promise.resolve() ensures .then() works even when the function returns undefined instead of a Promise.
This commit is contained in:
@@ -9,7 +9,7 @@ let initPromise = null;
|
||||
*/
|
||||
function ensureInitialized() {
|
||||
if (!initPromise) {
|
||||
initPromise = initTranslators().then(() => {
|
||||
initPromise = Promise.resolve(initTranslators()).then(() => {
|
||||
console.log("[SSE] Translators initialized");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user