Merge pull request #212 from 67P/bugfix/load_contributor
Fix dashboard hanging when loading app from contributor URL
This commit was merged in pull request #212.
This commit is contained in:
@@ -8,7 +8,13 @@ export default Route.extend({
|
|||||||
contributors: alias('kredits.contributors'),
|
contributors: alias('kredits.contributors'),
|
||||||
|
|
||||||
model (params) {
|
model (params) {
|
||||||
return this.contributors.findBy('id', params.id);
|
const contributor = this.contributors.findBy('id', params.id);
|
||||||
|
|
||||||
|
if (contributor) {
|
||||||
|
return contributor;
|
||||||
|
} else {
|
||||||
|
return this.kredits.fetchContributor(params.id);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setupController (controller, model) {
|
setupController (controller, model) {
|
||||||
|
|||||||
@@ -274,6 +274,12 @@ export default Service.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async fetchContributor (id) {
|
||||||
|
console.debug(`[kredits] Fetching contributor from the network`);
|
||||||
|
return this.kredits.Contributor.getById(id)
|
||||||
|
.then(data => this.loadContributorFromData(data))
|
||||||
|
},
|
||||||
|
|
||||||
fetchContributors () {
|
fetchContributors () {
|
||||||
console.debug(`[kredits] Fetching all contributors from the network`);
|
console.debug(`[kredits] Fetching all contributors from the network`);
|
||||||
return this.kredits.Contributor.all()
|
return this.kredits.Contributor.all()
|
||||||
|
|||||||
Reference in New Issue
Block a user