@@ -39,8 +39,6 @@ import { IDE_HEADER_HEIGHT } from "@appsmith/ads";
3939import { GitApplicationContextProvider } from "git-artifact-helpers/application/components" ;
4040import { AppIDEModals } from "ee/pages/AppIDE/components/AppIDEModals" ;
4141import { updateWindowDimensions } from "actions/windowActions" ;
42- import { debounce } from "lodash" ;
43- import { RESIZE_DEBOUNCE_THRESHOLD } from "pages/hooks/constants" ;
4442
4543interface EditorProps {
4644 currentApplicationId ?: string ;
@@ -70,8 +68,6 @@ type Props = EditorProps & RouteComponentProps<BuilderRouteParams>;
7068
7169class Editor extends Component < Props > {
7270 prevPageId : string | null = null ;
73- private handleResize : ( ( ) => void ) | null = null ;
74- private debouncedHandleResize : ReturnType < typeof debounce > | null = null ;
7571
7672 componentDidMount ( ) {
7773 const { basePageId } = this . props . match . params || { } ;
@@ -82,22 +78,8 @@ class Editor extends Component<Props> {
8278 this . props . widgetConfigBuildSuccess ( ) ;
8379 } ) ;
8480
85- // Set up window resize listener for window dimensions
86- this . handleResize = ( ) => {
87- this . props . updateWindowDimensions ( window . innerHeight , window . innerWidth ) ;
88- } ;
89-
90- // Create debounced version of resize handler
91- this . debouncedHandleResize = debounce (
92- this . handleResize ,
93- RESIZE_DEBOUNCE_THRESHOLD * 2 ,
94- ) ;
95-
96- // Set initial dimensions immediately
81+ // Set initial window dimensions
9782 this . props . updateWindowDimensions ( window . innerHeight , window . innerWidth ) ;
98-
99- // Add resize listener with debounced handler
100- window . addEventListener ( "resize" , this . debouncedHandleResize ) ;
10183 }
10284
10385 shouldComponentUpdate ( nextProps : Props ) {
@@ -182,13 +164,6 @@ class Editor extends Component<Props> {
182164 componentWillUnmount ( ) {
183165 this . props . resetEditorRequest ( ) ;
184166 urlBuilder . setCurrentBasePageId ( null ) ;
185-
186- // Clean up window resize listener
187- if ( this . debouncedHandleResize ) {
188- window . removeEventListener ( "resize" , this . debouncedHandleResize ) ;
189- // Cancel any pending debounced calls
190- this . debouncedHandleResize . cancel ( ) ;
191- }
192167 }
193168
194169 public render ( ) {
0 commit comments