Skip to content

A personal agent with a browser, terminal, files, and work that keeps going built with CopilotKit and AG-UI.

TypeScript

fix: normalize a typed browser address before opening a session (#102)

nvtoan0201-swe0e00e66b8d44
diff --git a/apps/mobile/src/screens.tsx b/apps/mobile/src/screens.tsx
index 2dc8bb0..5f2345a 100644
--- a/apps/mobile/src/screens.tsx
+++ b/apps/mobile/src/screens.tsx
@@ -39,6 +39,7 @@ import type {
EmailDraft,
} from "../../../packages/domain/src";
import { API_URL } from "./api";
+import { browserAddress } from "./browser-address";
import { localDateTime, startOfZonedDay, zonedInstant } from "./date-time";
import {
Button,
@@ -837,7 +838,9 @@ export function BrowserScreen() {
setError("");
setBusy(true);
try {
- const browser = await api.request<BrowserSession>("/api/browsers", { url });
+ const browser = await api.request<BrowserSession>("/api/browsers", {
+ url: browserAddress(url),
+ });
await refresh();
setUrl("");
open({ type: "browser", browser });