|
|
@ -26,7 +26,7 @@ export const useDragTerminal = (minHeight: number, defaultPosition: number) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleDraggingEnd = () => { |
|
|
|
const handleDraggingEnd = () => { |
|
|
|
if(!isDragging) return |
|
|
|
if (!isDragging) return |
|
|
|
|
|
|
|
|
|
|
|
setIsDragging(false) |
|
|
|
setIsDragging(false) |
|
|
|
|
|
|
|
|
|
|
@ -38,7 +38,7 @@ export const useDragTerminal = (minHeight: number, defaultPosition: number) => { |
|
|
|
event.preventDefault() |
|
|
|
event.preventDefault() |
|
|
|
event.stopPropagation() |
|
|
|
event.stopPropagation() |
|
|
|
|
|
|
|
|
|
|
|
if(isOpen) { |
|
|
|
if (isOpen) { |
|
|
|
setLastTerminalPosition(terminalPosition) |
|
|
|
setLastTerminalPosition(terminalPosition) |
|
|
|
setLastYPosition(0) |
|
|
|
setLastYPosition(0) |
|
|
|
setTerminalPosition(minHeight) |
|
|
|
setTerminalPosition(minHeight) |
|
|
@ -62,7 +62,7 @@ export const useDragTerminal = (minHeight: number, defaultPosition: number) => { |
|
|
|
|
|
|
|
|
|
|
|
// Reset terminal position
|
|
|
|
// Reset terminal position
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(!terminalPosition){ |
|
|
|
if (!terminalPosition) { |
|
|
|
setTerminalPosition(defaultPosition) |
|
|
|
setTerminalPosition(defaultPosition) |
|
|
|
} |
|
|
|
} |
|
|
|
}, [terminalPosition, setTerminalPosition]) |
|
|
|
}, [terminalPosition, setTerminalPosition]) |
|
|
|