Skip to content

Commit

Permalink
fix browser input
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Feb 28, 2025
1 parent 55b392b commit 58d0661
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion frontend/src/components/features/browser/browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { RootState } from "#/store";
import { updateBrowserTabUrl } from "#/services/browse-service";
import { BrowserSnapshot } from "./browser-snapshot";
import { EmptyBrowserMessage } from "./empty-browser-message";
import { useWsClient } from "#/context/ws-client-provider";

export function BrowserPanel() {
const { send } = useWsClient();
const { url, screenshotSrc } = useSelector(
(state: RootState) => state.browser,
);
Expand All @@ -17,7 +20,7 @@ export function BrowserPanel() {

const handleURLBar = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === "Enter") {
updateBrowserTabUrl(editableUrl);
send(updateBrowserTabUrl(editableUrl));
}
};

Expand Down
6 changes: 2 additions & 4 deletions frontend/src/services/browse-service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import ActionType from "#/types/action-type";
// import Session from "./session";

export function updateBrowserTabUrl(newUrl: string): void {
export function updateBrowserTabUrl(newUrl: string) {
const event = { action: ActionType.BROWSE, args: { url: newUrl } };
const eventString = JSON.stringify(event);
// Session.send(eventString);
return event;
}

0 comments on commit 58d0661

Please sign in to comment.