MCPcopy Create free account
hub / github.com/DTStack/molecule / remove

Method remove

src/services/problemsService.ts:121–144  ·  view source on GitHub ↗
(id: UniqueId | UniqueId[])

Source from the content-addressed store, hash-verified

119 );
120 }
121 public remove(id: UniqueId | UniqueId[]): void {
122 const ids = Array.isArray(id) ? id : [id];
123
124 const { data = [] } = this.state;
125 ids.forEach((problemId) => {
126 const index = data.findIndex(searchById(problemId));
127 if (index > -1) {
128 data.splice(index, 1);
129 } else {
130 logger.error(
131 `Remove problems failed, because there is no problem found via ${problemId}`
132 );
133 }
134 });
135
136 this.setState(
137 {
138 data: [...data],
139 },
140 () => {
141 this.updateStatusBar();
142 }
143 );
144 }
145
146 public reset(): void {
147 const { builtInStatusProblems } = this.builtinService.getModules();

Callers

nothing calls this directly

Calls 3

updateStatusBarMethod · 0.95
searchByIdFunction · 0.90
setStateMethod · 0.80

Tested by

no test coverage detected