Fix bulk delete error by making delById more defensive

- Extract map reference to local variable before iteration
- Change from forEach to for-of loop for better error handling
- Add null check on map before iterating
- Add @popperjs/core peer dependency for ng-bootstrap
- Update .gitignore to exclude package-lock.json

Co-authored-by: alexta69 <7450369+alexta69@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-10 16:17:22 +00:00
parent c13431c10d
commit 846c4f0e52
3 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@
# dependencies
/ui/node_modules
/ui/package-lock.json
# profiling files
chrome-profiler-events*.json

View File

@@ -38,6 +38,7 @@
"@fortawesome/free-solid-svg-icons": "^7.1.0",
"@ng-bootstrap/ng-bootstrap": "^20.0.0",
"@ng-select/ng-select": "^21.1.0",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.6",
"ngx-cookie-service": "^21.1.0",
"ngx-socket-io": "~4.9.3",
@@ -59,4 +60,4 @@
"typescript-eslint": "8.47.0",
"vitest": "^4.0.8"
}
}
}

View File

@@ -118,12 +118,15 @@ export class DownloadsService {
}
public delById(where: State, ids: string[]) {
ids.forEach(id => {
const obj = this[where].get(id)
if (obj) {
obj.deleting = true
const map = this[where];
if (map) {
for (const id of ids) {
const obj = map.get(id);
if (obj) {
obj.deleting = true;
}
}
});
}
return this.http.post('delete', {where: where, ids: ids});
}