Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions apps/desktop/src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function App(): JSX.Element {
const activateTabByIndex = useAppStore((s) => s.activateTabByIndex);
const reopenClosedTab = useAppStore((s) => s.reopenClosedTab);
const activeTabId = useAppStore((s) => s.activeTabId);
const send = useAppStore((s) => s.send);
const saveOrPrompt = useAppStore((s) => s.saveOrPrompt);
const focusUrl = useAppStore((s) => s.focusUrl);

Expand Down Expand Up @@ -77,7 +76,19 @@ export function App(): JSX.Element {
handler: () => activeTabId && duplicateTab(activeTabId),
},
{ combo: 'mod+l', description: 'Focus URL bar', handler: () => focusUrl() },
{ combo: 'mod+enter', description: 'Send request', handler: () => void send() },
{
combo: 'mod+enter',
description: 'Send / cancel request',
handler: () => {
const state = useAppStore.getState();
const tab = state.tabs.find((t) => t.id === state.activeTabId);
if (tab?.execution.status === 'sending') {
state.cancelSend();
} else {
void state.send();
}
},
},
{ combo: 'mod+s', description: 'Save request', handler: () => void saveOrPrompt() },
{
combo: 'mod+shift+t',
Expand All @@ -98,7 +109,6 @@ export function App(): JSX.Element {
activateTabByIndex,
reopenClosedTab,
activeTabId,
send,
saveOrPrompt,
focusUrl,
paletteOpen,
Expand Down
Loading