Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async addActivity(activityDefinition: ActivityDefinition) {
const left = !!this.lastClickedLocation ? this.lastClickedLocation.left : 150;
const top = !!this.lastClickedLocation ? this.lastClickedLocation.top : 150;
const activity: Activity = {
id: uuid(),
top: top,
left: left,
type: activityDefinition.type,
state: {}
};
this.lastClickedLocation = null;
const activities = [...this.workflow.activities, activity];
this.workflow = { ...this.workflow, activities };
}