🐛 Fix issue that none active workflow got displayed as active

This commit is contained in:
Jan Oberhauser 2020-10-21 10:26:15 +02:00
parent 70435b582a
commit 3afc7a3deb

View file

@ -181,8 +181,9 @@ export class ActiveWorkflowRunner {
* @returns {string[]} * @returns {string[]}
* @memberof ActiveWorkflowRunner * @memberof ActiveWorkflowRunner
*/ */
getActiveWorkflows(): Promise<IWorkflowDb[]> { async getActiveWorkflows(): Promise<IWorkflowDb[]> {
return Db.collections.Workflow?.find({ where: { active: true }, select: ['id'] }) as Promise<IWorkflowDb[]>; const activeWorkflows = await Db.collections.Workflow?.find({ where: { active: true }, select: ['id'] }) as IWorkflowDb[];
return activeWorkflows.filter(workflow => this.activationErrors[workflow.id.toString()] === undefined);
} }