import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';

export default Component.extend({
  currentUser: service(),
  store: service(),
  flashMessages: service(),
  startRoundModal: false,
  startRoundModalError: false,
  startRound: task(function *() {
    try {
      let round = yield this.model.start({
        'by': this.get('currentUser.user.id')
      });
      this.model.reload();
      this.get('store').pushPayload('round', round);
      this.get('model.session.competitors').invoke('reload');
      this.get('model.appearances').invoke('reload');
      this.set('startRoundModal', false);
      this.set('startRoundModalError', false);
      this.get('flashMessages').success("Started!");
    } catch(e) {
      this.set('startRoundModalError', true);
    }
  }).drop(),
});

import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';

export default Component.extend({
  currentUser: service(),
  store: service(),
  flashMessages: service(),
  startRoundModal: false,
  startRoundModalError: false,
  startRound: task(function *() {
    try {
      let round = yield this.model.start({
        'by': this.get('currentUser.user.id')
      });
      yield this.model.reload();
      yield this.get('store').pushPayload('round', round);
      yield this.get('model.session.competitors').invoke('reload');
      yield this.get('model.appearances').invoke('reload');
      yield this.get('model.panelists').invoke('reload');
      this.set('startRoundModal', false);
      this.set('startRoundModalError', false);
      this.get('flashMessages').success("Started!");
    } catch(e) {
      this.set('startRoundModalError', true);
    }
  }).drop(),
});

Add yields to avoid race conditions
Add yields to avoid race conditions
