MCPcopy Create free account
hub / github.com/material-shell/material-shell / removeDialog

Method removeDialog

src/layout/msWorkspace/msWindow.ts:1064–1081  ·  view source on GitHub ↗
(metaWindow: MetaWindowWithMsProperties)

Source from the content-addressed store, hash-verified

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') {

Callers 2

removeAllDialogsMethod · 0.95
metaWindowUnManagedMethod · 0.95

Calls 3

spliceMethod · 0.65
remove_childMethod · 0.65
destroyMethod · 0.65

Tested by

no test coverage detected