feat(web): route checkConnection and discovery through the proxy

This commit is contained in:
Offending Commit
2026-06-02 11:52:17 -05:00
parent 90823d12a6
commit 9893230cde
3 changed files with 59 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
import { httpFetch } from "@/lib/http";
import { dispatchFor } from "@/lib/dispatch";
import { isTauri } from "@/lib/platform";
export { isTauri } from "@/lib/platform";
@@ -37,9 +37,10 @@ export function deriveNameFromWorkspaceId(workspaceId: string): string {
*/
export async function suggestNameForInstance(baseUrl: string): Promise<string | null> {
try {
const res = await httpFetch(`${baseUrl}/v3/workspaces/list?page=1&page_size=1`, {
const { baseUrl: base, headers, fetch } = dispatchFor({ baseUrl });
const res = await fetch(`${base}/v3/workspaces/list?page=1&page_size=1`, {
method: "POST",
headers: { "Content-Type": "application/json" },
headers,
body: JSON.stringify({}),
signal: AbortSignal.timeout(2000),
});