message: Simplify workflow-card `check` execution and make sure that it runs before capturing `lastCompletedCardName`
diff: @@ -29,7 +29,9 @@ interface WorkflowCardOptions {
  export class WorkflowCard extends WorkflowPostable {
  cardName: string;
  componentName: string;
  - check?: (this: WorkflowCard) => Promise<CheckResult>;
  + check: (this: WorkflowCard) => Promise<CheckResult> = () => {
  + return Promise.resolve({ success: true });
  + };
  constructor(options: Partial<WorkflowCardOptions>) {
  super(options.author!, options.includeIf);
  @@ -41,15 +43,16 @@ export class WorkflowCard extends WorkflowPostable {
  this.isComplete = false;
  }
  };
  + if (options.check) {
  this.check = options.check;
  }
  + }
  get session(): WorkflowSession | undefined {
  return this.workflow?.session;
  }
  - @action onComplete() {
  - if (this.check) {
  - this.check().then((checkResult) => {
  + @action async onComplete() {
  + let checkResult = await this.check();
  if (checkResult.success) {
  // visible-postables-will-change starts test waiters in animated-workflow.ts
  this.workflow?.emit('visible-postables-will-change');
  @@ -57,11 +60,6 @@ export class WorkflowCard extends WorkflowPostable {
  } else {
  this.workflow?.cancel(checkResult.reason);
  }
  - });
  - } else {
  - this.workflow?.emit('visible-postables-will-change');
  - this.isComplete = true;
  - }
  if (this.isComplete && this.cardName) {
  this.workflow?.session.update('lastCompletedCardName', this.cardName);
  