Skip to content

Commit

Permalink
Wire up some more
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Sep 11, 2024
1 parent 2d615a1 commit 10f97a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/tracer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import Editor from "@monaco-editor/react";
import { useEffect, useState } from "react";
import useWebSocket from "react-use-websocket";

const USE_META_KEY = navigator.platform.indexOf("Mac") === 0 || navigator.platform === "iPhone";

function App() {
const [handlers, setHandlers] = useState<Handler[]>([]);
const [selectedScope, setSelectedScope] = useState("");
Expand Down Expand Up @@ -87,7 +89,7 @@ function App() {
}

const handler = editor!.onKeyDown(e => {
if (e.ctrlKey && e.keyCode === monaco.KeyCode.KeyS) {
if ((USE_META_KEY ? e.metaKey : e.ctrlKey) && e.keyCode === monaco.KeyCode.KeyS) {
handleDeployClick();
e.preventDefault();
}
Expand Down

0 comments on commit 10f97a3

Please sign in to comment.