MCPcopy
hub / github.com/alibaba/lowcode-engine / remove

Method remove

packages/workspace/src/workspace.ts:214–230  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

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)));

Callers 3

removeEditorWindowMethod · 0.95

Calls 5

emitChangeWindowMethod · 0.95
spliceMethod · 0.65
updateStateMethod · 0.65
initMethod · 0.65

Tested by

no test coverage detected