Skip to content

Commit 143e3d9

Browse files
waleedlatif1emir-karabeg
authored andcommitted
remove dead state variable, add logs
1 parent b8c07e5 commit 143e3d9

File tree

2 files changed

+3
-44
lines changed

2 files changed

+3
-44
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/action-bar/action-bar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export function ActionBar() {
6161
const handleHide = async () => {
6262
try {
6363
await updateSetting.mutateAsync({ key: 'showActionBar', value: false })
64+
} catch (error) {
65+
logger.error('Failed to hide action bar', error)
6466
} finally {
6567
setContextMenu(null)
6668
}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,50 +1931,7 @@ const WorkflowContent = React.memo(() => {
19311931
const [displayNodes, setDisplayNodes] = useState<Node[]>([])
19321932

19331933
useEffect(() => {
1934-
const handleKeyDown = (e: KeyboardEvent) => {
1935-
if (e.key === 'Shift') setIsShiftPressed(true)
1936-
}
1937-
const handleKeyUp = (e: KeyboardEvent) => {
1938-
if (e.key === 'Shift') setIsShiftPressed(false)
1939-
}
1940-
const handleFocusLoss = () => {
1941-
setIsShiftPressed(false)
1942-
}
1943-
const handleVisibilityChange = () => {
1944-
if (document.hidden) {
1945-
handleFocusLoss()
1946-
}
1947-
}
1948-
1949-
window.addEventListener('keydown', handleKeyDown)
1950-
window.addEventListener('keyup', handleKeyUp)
1951-
window.addEventListener('blur', handleFocusLoss)
1952-
document.addEventListener('visibilitychange', handleVisibilityChange)
1953-
1954-
return () => {
1955-
window.removeEventListener('keydown', handleKeyDown)
1956-
window.removeEventListener('keyup', handleKeyUp)
1957-
window.removeEventListener('blur', handleFocusLoss)
1958-
document.removeEventListener('visibilitychange', handleVisibilityChange)
1959-
}
1960-
}, [])
1961-
1962-
useEffect(() => {
1963-
if (isShiftPressed) {
1964-
document.body.style.userSelect = 'none'
1965-
} else {
1966-
document.body.style.userSelect = ''
1967-
}
1968-
return () => {
1969-
document.body.style.userSelect = ''
1970-
}
1971-
}, [isShiftPressed])
1972-
1973-
useEffect(() => {
1974-
// Check for pending selection (from paste/duplicate), otherwise preserve existing selection
1975-
const pendingSelection = pendingSelectionRef.current
1976-
pendingSelectionRef.current = null
1977-
1934+
// Preserve selection state when syncing from derivedNodes
19781935
setDisplayNodes((currentNodes) => {
19791936
if (pendingSelection) {
19801937
// Apply pending selection and resolve parent-child conflicts

0 commit comments

Comments
 (0)