Fix display bug with inactive boards
This commit is contained in:
parent
085291ce94
commit
d4ca6f4f53
@ -68,18 +68,13 @@ export class AutoActions {
|
|||||||
settings.boardsChanged
|
settings.boardsChanged
|
||||||
.subscribe((boards: Array<Board>) => {
|
.subscribe((boards: Array<Board>) => {
|
||||||
this.boards = boards;
|
this.boards = boards;
|
||||||
|
this.updateHasInactiveBoards();
|
||||||
boards.forEach(board => {
|
|
||||||
if (!(+board.is_active)) {
|
|
||||||
this.hasInactiveBoards = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
settings.actionsChanged
|
settings.actionsChanged
|
||||||
.subscribe((actionList: Array<AutoAction>) => {
|
.subscribe((actionList: Array<AutoAction>) => {
|
||||||
this.autoActions = actionList;
|
this.autoActions = actionList;
|
||||||
this.hasInactiveBoards = false;
|
this.updateHasInactiveBoards();
|
||||||
|
|
||||||
this.autoActions.sort((a, b) => {
|
this.autoActions.sort((a, b) => {
|
||||||
let nameA = this.getBoardName(a.board_id),
|
let nameA = this.getBoardName(a.board_id),
|
||||||
@ -332,6 +327,16 @@ export class AutoActions {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private updateHasInactiveBoards(): void {
|
||||||
|
this.hasInactiveBoards = false;
|
||||||
|
|
||||||
|
this.boards.forEach(board => {
|
||||||
|
if (!(+board.is_active)) {
|
||||||
|
this.hasInactiveBoards = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private handleResponse(response: ApiResponse): void {
|
private handleResponse(response: ApiResponse): void {
|
||||||
response.alerts.forEach(alert => {
|
response.alerts.forEach(alert => {
|
||||||
this.notes.add(alert);
|
this.notes.add(alert);
|
||||||
|
Reference in New Issue
Block a user