(metaWindow: MetaWindowWithMsProperties)
| 1062 | } |
| 1063 | |
| 1064 | removeDialog(metaWindow: MetaWindowWithMsProperties) { |
| 1065 | if (this.lifecycleState.type !== 'window') { |
| 1066 | throw new Error('Can only remove dialogs when in the window state'); |
| 1067 | } |
| 1068 | |
| 1069 | const idx = this.lifecycleState.dialogs.findIndex( |
| 1070 | (x) => x.metaWindow == metaWindow |
| 1071 | ); |
| 1072 | if (idx === -1) { |
| 1073 | throw new Error('Dialog is not added to window'); |
| 1074 | } |
| 1075 | |
| 1076 | const dialog = this.lifecycleState.dialogs[idx]; |
| 1077 | this.lifecycleState.dialogs.splice(idx, 1); |
| 1078 | this.remove_child(dialog.clone); |
| 1079 | dialog.clone.destroy(); |
| 1080 | metaWindow.msWindow = undefined; |
| 1081 | } |
| 1082 | |
| 1083 | onMetaWindowsChanged() { |
| 1084 | if (this.lifecycleState.type == 'window') { |
no test coverage detected