@@ -59,12 +59,11 @@ export class WinboxService {
5959 const optionsClose = options . onclose ;
6060 winBox . onclose = ( force ) => {
6161 if ( force ) {
62- return this . destroyComponent ( componentRef , winBox ) ;
62+ return this . destroyComponent < ComponentInstance > ( componentRef , winBox ) ;
6363 }
64-
6564 const isCloseConfirmed = optionsClose ?. apply ( winBox , [ force ] ) ;
66- if ( isCloseConfirmed ) {
67- return this . destroyComponent ( componentRef , winBox ) ;
65+ if ( isCloseConfirmed || ! optionsClose ) {
66+ return this . destroyComponent < ComponentInstance > ( componentRef , winBox ) ;
6867 }
6968 return true ;
7069 } ;
@@ -80,7 +79,7 @@ export class WinboxService {
8079
8180 public closeAllWinBoxes ( ) {
8281 for ( const winBox of this . winBoxStack ) {
83- winBox . close ( ) ;
82+ winBox . close ( true ) ;
8483 }
8584 this . winBoxStack = [ ] ;
8685 this . isThereAWinBox = false ;
@@ -102,8 +101,8 @@ export class WinboxService {
102101 this . winBoxStack . find ( ( winbox ) => winbox . id === id ) ?. maximize ( state ) ;
103102 }
104103
105- private destroyComponent (
106- componentRef : ComponentRef < any > ,
104+ private destroyComponent < ComponentInstance > (
105+ componentRef : ComponentRef < ComponentInstance > ,
107106 winBox : WinBox
108107 ) : boolean {
109108 componentRef . destroy ( ) ;
0 commit comments