Don't double render, also don't render infinitely
See https://github.com/emberjs/ember.js/issues/13948
This commit is contained in:
parent
094de84c98
commit
3d93398eae
|
@ -45,12 +45,19 @@ export default Component.extend({
|
|||
// being resolved through the store (store.findAll('job')). The
|
||||
// workaround is to persist the jobID as a string on the allocation
|
||||
// and manually re-link the two records here.
|
||||
run.scheduleOnce('afterRender', this, qualifyJob);
|
||||
},
|
||||
});
|
||||
|
||||
run.next(() => {
|
||||
function qualifyJob() {
|
||||
const allocation = this.get('allocation');
|
||||
if (allocation.get('originalJobId')) {
|
||||
const job = this.get('store').peekRecord('job', allocation.get('originalJobId'));
|
||||
if (job) {
|
||||
allocation.set('job', job);
|
||||
allocation.setProperties({
|
||||
job,
|
||||
originalJobId: null,
|
||||
});
|
||||
} else {
|
||||
this.get('store')
|
||||
.findRecord('job', allocation.get('originalJobId'))
|
||||
|
@ -58,6 +65,5 @@ export default Component.extend({
|
|||
allocation.set('job', job);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue