(index: number)
| 212 | } |
| 213 | |
| 214 | private async remove(index: number) { |
| 215 | if (index < 0) { |
| 216 | return; |
| 217 | } |
| 218 | const window = this.windows[index]; |
| 219 | this.windows.splice(index, 1); |
| 220 | this.window?.updateState(WINDOW_STATE.destroyed); |
| 221 | if (this.window === window) { |
| 222 | this.window = this.windows[index] || this.windows[index + 1] || this.windows[index - 1]; |
| 223 | if (this.window?.sleep) { |
| 224 | await this.window.init(); |
| 225 | } |
| 226 | this.emitChangeActiveWindow(); |
| 227 | } |
| 228 | this.emitChangeWindow(); |
| 229 | this.window?.updateState(WINDOW_STATE.active); |
| 230 | } |
| 231 | |
| 232 | removeEditorWindow(resourceName: string, id: string) { |
| 233 | const index = this.windows.findIndex(d => (d.resource?.name === resourceName && (d.title === id || d.resource.id === id))); |
no test coverage detected