🐛 Fix autocomplete submit

Closes #1402
This commit is contained in:
Baptiste Arnaud
2024-04-03 10:18:55 +02:00
parent 68ad0f2d4c
commit b5dd12c6fe
9 changed files with 24 additions and 15 deletions

View File

@@ -25,8 +25,13 @@ export const guessApiHost = (
return chatApiUrl
}
return (
getRuntimeVariable('NEXT_PUBLIC_VIEWER_URL')?.split(',')[0] ??
chatApiCloudFallbackHost
const viewerUrls = getRuntimeVariable('NEXT_PUBLIC_VIEWER_URL')?.split(
','
) as string[] | undefined
const matchedUrl = viewerUrls?.find((url) =>
window.location.href.startsWith(url)
)
return matchedUrl ?? chatApiCloudFallbackHost
}