@@ -9,8 +9,15 @@ function toPx(value: number) {
99interface UseWindowMinMaxProps {
1010 windowRef : React . RefObject < HTMLElement > ;
1111 windowRect : MutableRefObject < Partial < Rect > > ;
12+ windowType : string ;
13+ windowId : string ;
1214}
13- function useWindowMinMax ( { windowRect, windowRef } : UseWindowMinMaxProps ) {
15+ function useWindowMinMax ( {
16+ windowRect,
17+ windowRef,
18+ windowId,
19+ windowType,
20+ } : UseWindowMinMaxProps ) {
1421 const winMan = useWindowManagerStore ( ) ;
1522 const oldTransition = useRef < string > ( "" ) ;
1623 const oldTransform = useRef < string > ( "" ) ;
@@ -49,16 +56,14 @@ function useWindowMinMax({ windowRect, windowRef }: UseWindowMinMaxProps) {
4956
5057 function handleTransitionEnd ( e : TransitionEvent ) {
5158 const window = windowRef . current ;
52- if ( ! window ) return ;
53- if ( e . target === window ) {
54- console . log ( "Setting no display" ) ;
55- if ( window . style ) {
56- window . style . display = "inline" ;
57- window . style . transition = oldTransition . current ;
58- window . style . transform = oldTransform . current ;
59- window . style . opacity = oldOpacity . current ;
60- }
61- }
59+ if ( ! window ?. style ) return ;
60+ if ( e . target !== window ) return ;
61+
62+ window . style . display = "none" ;
63+ window . style . transition = oldTransition . current ;
64+ window . style . transform = oldTransform . current ;
65+ window . style . opacity = oldOpacity . current ;
66+ winMan . hideWindow ( windowType , windowId ) ;
6267 }
6368
6469 useEffect ( ( ) => {
0 commit comments