resize disconect

This commit is contained in:
mpetrov 2025-02-12 16:13:17 +02:00
parent e542267295
commit ebed39a936

View File

@ -20,6 +20,7 @@ import {
DestroyRef, DestroyRef,
ElementRef, ElementRef,
Inject, Inject,
OnDestroy,
ViewChild, ViewChild,
} from '@angular/core'; } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
@ -45,7 +46,7 @@ import { CalculatedFieldTestScriptDialogData } from '@shared/models/calculated-f
styleUrls: ['./calculated-field-script-test-dialog.component.scss'], styleUrls: ['./calculated-field-script-test-dialog.component.scss'],
}) })
export class CalculatedFieldScriptTestDialogComponent extends DialogComponent<CalculatedFieldScriptTestDialogComponent, export class CalculatedFieldScriptTestDialogComponent extends DialogComponent<CalculatedFieldScriptTestDialogComponent,
string> implements AfterViewInit { string> implements AfterViewInit, OnDestroy {
@ViewChild('leftPanel', {static: true}) leftPanelElmRef: ElementRef<HTMLElement>; @ViewChild('leftPanel', {static: true}) leftPanelElmRef: ElementRef<HTMLElement>;
@ViewChild('rightPanel', {static: true}) rightPanelElmRef: ElementRef<HTMLElement>; @ViewChild('rightPanel', {static: true}) rightPanelElmRef: ElementRef<HTMLElement>;
@ -87,6 +88,11 @@ export class CalculatedFieldScriptTestDialogComponent extends DialogComponent<Ca
this.observeResize(); this.observeResize();
} }
ngOnDestroy(): void {
super.ngOnDestroy();
this.testScriptResize.disconnect();
}
cancel(): void { cancel(): void {
this.dialogRef.close(null); this.dialogRef.close(null);
} }