Skip to content

Commit

Permalink
fix: restrict terminal command buttons to macOS only
Browse files Browse the repository at this point in the history
  • Loading branch information
hichemfantar committed Nov 16, 2024
1 parent 4fa0a15 commit 977082c
Showing 1 changed file with 42 additions and 38 deletions.
80 changes: 42 additions & 38 deletions src/frontend/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,25 +372,27 @@ export function App() {
<p>Copy to Clipboard</p>
</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger asChild>
<Button
type="submit"
size="sm"
className="px-3"
onClick={async () => {
await window.bridge.runCommandInTerminal(
"at -l"
);
}}
>
<TerminalIcon />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>Run in Terminal</p>
</TooltipContent>
</Tooltip>
{getOsQuery.data === "darwin" && (
<Tooltip>
<TooltipTrigger asChild>
<Button
type="submit"
size="sm"
className="px-3"
onClick={async () => {
await window.bridge.runCommandInTerminal(
"at -l"
);
}}
>
<TerminalIcon />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>Run in Terminal</p>
</TooltipContent>
</Tooltip>
)}
</div>
</div>
<div className="flex flex-col gap-2 mt-4">
Expand Down Expand Up @@ -424,25 +426,27 @@ export function App() {
<p>Copy to Clipboard</p>
</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger asChild>
<Button
type="submit"
size="sm"
className="px-3"
onClick={async () => {
await window.bridge.runCommandInTerminal(
"crontab -l"
);
}}
>
<TerminalIcon />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>Run in Terminal</p>
</TooltipContent>
</Tooltip>
{getOsQuery.data === "darwin" && (
<Tooltip>
<TooltipTrigger asChild>
<Button
type="submit"
size="sm"
className="px-3"
onClick={async () => {
await window.bridge.runCommandInTerminal(
"crontab -l"
);
}}
>
<TerminalIcon />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>Run in Terminal</p>
</TooltipContent>
</Tooltip>
)}
</div>
</div>
</div>
Expand Down

0 comments on commit 977082c

Please sign in to comment.