Load contributors from cache if present

And then update from network later
This commit is contained in:
2020-05-28 10:54:38 +02:00
parent 50e1fc728c
commit 832de3c06f
3 changed files with 50 additions and 12 deletions
+6
View File
@@ -1,5 +1,6 @@
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import { schedule } from '@ember/runloop';
export default Route.extend({
kredits: service(),
@@ -21,6 +22,11 @@ export default Route.extend({
return this.kredits.loadInitialData()
.then(() => {
this.kredits.addContractEventHandlers();
})
.then(() => {
if (this.kredits.contributorsNeedFetch) {
schedule('afterRender', this.kredits, this.kredits.fetchContributors);
}
});
}
});