/*
 * Copyright (C) 2019 Robert Bosch GmbH Copyright (C) 2019 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root',
})
export class BciMessagesFilterService {
  private _types = [];

  get filter(): Array<string> {
    return this._types;
  }

  set filter(filter: Array<string>) {
    this._types = filter;
  }

  public deactivateFilter(type: string): void {
    const index = this._types.indexOf(type);
    if (index > -1) {
      this.filter.splice(index, 1);
    }
  }
}
