Files
showbridge-webui/src/app/services/lists.ts
T
2026-05-17 22:12:21 -05:00

34 lines
706 B
TypeScript

import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class ListsService {
public processorListIds: string[] = [];
registerProcessorList(path: string | undefined) {
if (path === undefined) {
return '';
}
const id = this.pathToId(path);
if (!this.processorListIds.includes(id)) {
this.processorListIds.push(id);
}
return id;
}
removeProcessorList(path: string | undefined) {
if (path === undefined) {
return;
}
const id = this.pathToId(path);
this.processorListIds = this.processorListIds.filter((listId) => listId !== id);
}
pathToId(path: string) {
return path.replaceAll('/', '.');
}
}