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