Skip to content

Commit

Permalink
fix: copy and paste shortcut in the textarea of the workflow run panel (
Browse files Browse the repository at this point in the history
  • Loading branch information
YIXIAO0 authored Sep 13, 2024
1 parent 5f03e66 commit 8d2269f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/app/components/workflow/hooks/use-shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,16 @@ export const useShortcuts = (): void => {
})

useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.c`, (e) => {
const { showDebugAndPreviewPanel, showInputsPanel } = workflowStore.getState()
if (shouldHandleShortcut(e) && !showDebugAndPreviewPanel && !showInputsPanel) {
const { showDebugAndPreviewPanel } = workflowStore.getState()
if (shouldHandleShortcut(e) && !showDebugAndPreviewPanel) {
e.preventDefault()
handleNodesCopy()
}
}, { exactMatch: true, useCapture: true })

useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.v`, (e) => {
if (shouldHandleShortcut(e)) {
const { showDebugAndPreviewPanel } = workflowStore.getState()
if (shouldHandleShortcut(e) && !showDebugAndPreviewPanel) {
e.preventDefault()
handleNodesPaste()
}
Expand All @@ -99,7 +100,8 @@ export const useShortcuts = (): void => {
}, { exactMatch: true, useCapture: true })

useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.z`, (e) => {
if (shouldHandleShortcut(e)) {
const { showDebugAndPreviewPanel } = workflowStore.getState()
if (shouldHandleShortcut(e) && !showDebugAndPreviewPanel) {
e.preventDefault()
workflowHistoryShortcutsEnabled && handleHistoryBack()
}
Expand Down

0 comments on commit 8d2269f

Please sign in to comment.