Skip to content

Commit 178c62f

Browse files
committed
Added a fix for infinite loading bug
1 parent 40ad90d commit 178c62f

File tree

5 files changed

+38
-36
lines changed

5 files changed

+38
-36
lines changed

src/assets/badges/predefined/predefinedBadges.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export default class PredefinedBadges {
99
url = "/assets/badges/predefined/" + badge.badge;
1010
}
1111
});
12-
console.log(url);
1312
return url;
1413
}
1514
}

src/components/auth/Login.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export default {
3535
const code = window.location.href.match(/\?code=(.*)/);
3636
if (code) {
3737
this.isLoading = true;
38-
console.log(this.isLoading);
3938
axios({
4039
method: `post`,
4140
url: `${AxiosHelper.gatekeeperUrl}?client_id=${

src/components/org/OrgContributors.vue

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,40 @@ export default {
4242
methods: {
4343
async load(cutoff) {
4444
//Set org status as loading
45-
this.$store.commit("SET_ORG_STATUS", {orgName: this.orgName, status: false})
45+
this.$store.commit("SET_ORG_STATUS", {
46+
orgName: this.orgName,
47+
status: false
48+
});
4649
4750
let topContributors = [];
4851
const orgRepos = await this.getRepos();
49-
50-
for (let i = 0; i < orgRepos.length; i++) {
51-
const contributors = await this.getContributors(orgRepos[i].name);
52-
console.log(orgRepos[i].name);
53-
contributors.forEach(function(contributor) {
54-
if (!topContributors.hasOwnProperty(contributor.author.login)) {
55-
topContributors[contributor.author.login] = {
56-
name: contributor.author.login,
57-
total: contributor.total,
58-
weeks: contributor.weeks,
59-
avatar: contributor.author.avatar_url
60-
};
61-
} else {
62-
topContributors[contributor.author.login].total +=
63-
contributor.total;
64-
for (let j = 0; j < contributor.weeks.length; j++) {
65-
topContributors[contributor.author.login].weeks[j].c +=
66-
contributor.weeks[j].c;
67-
topContributors[contributor.author.login].weeks[j].a +=
68-
contributor.weeks[j].a;
69-
topContributors[contributor.author.login].weeks[j].d +=
70-
contributor.weeks[j].d;
52+
try {
53+
for (let i = 0; i < orgRepos.length; i++) {
54+
const contributors = await this.getContributors(orgRepos[i].name);
55+
contributors.forEach(function(contributor) {
56+
if (!topContributors.hasOwnProperty(contributor.author.login)) {
57+
topContributors[contributor.author.login] = {
58+
name: contributor.author.login,
59+
total: contributor.total,
60+
weeks: contributor.weeks,
61+
avatar: contributor.author.avatar_url
62+
};
63+
} else {
64+
topContributors[contributor.author.login].total +=
65+
contributor.total;
66+
for (let j = 0; j < contributor.weeks.length; j++) {
67+
topContributors[contributor.author.login].weeks[j].c +=
68+
contributor.weeks[j].c;
69+
topContributors[contributor.author.login].weeks[j].a +=
70+
contributor.weeks[j].a;
71+
topContributors[contributor.author.login].weeks[j].d +=
72+
contributor.weeks[j].d;
73+
}
7174
}
72-
}
73-
console.log(contributor);
74-
});
75+
});
76+
}
77+
} catch (err) {
78+
console.log(err);
7579
}
7680
7781
//store this
@@ -84,15 +88,18 @@ export default {
8488
this.$store.dispatch("sortTopMonthCommits");
8589
this.$store.dispatch("sortTopYearCommits");
8690
87-
topContributors = this.$store.getters.getTopCommits(this.orgName)
91+
topContributors = this.$store.getters.getTopCommits(this.orgName);
8892
8993
for (let data in topContributors) {
9094
if (cutoff <= 0) break;
9195
this.contributors.push(topContributors[data]);
9296
cutoff--;
9397
}
9498
this.isLoading = false;
95-
this.$store.commit("SET_ORG_STATUS", {orgName: this.orgName, status: true});
99+
this.$store.commit("SET_ORG_STATUS", {
100+
orgName: this.orgName,
101+
status: true
102+
});
96103
},
97104
async getRepos() {
98105
const res = await axios
@@ -130,7 +137,7 @@ export default {
130137
</script>
131138

132139
<style>
133-
.contributor {
134-
padding-left: 25px;
135-
}
140+
.contributor {
141+
padding-left: 25px;
142+
}
136143
</style>

src/components/org/RepoContributors.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ export default {
5353
.then(res => {
5454
this.sortContributors(res.data);
5555
this.contributors = res.data;
56-
console.log(res.data);
57-
console.log(this.contributors[0].author.avatar_url);
5856
})
5957
.catch(err => console.log(err));
6058
},

src/store.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export default new Vuex.Store({
3131
state.orgCommits[payload.orgName] = [];
3232
for(let user in payload.data)
3333
state.orgCommits[payload.orgName].push(payload.data[user]);
34-
console.log(state.orgCommits);
3534
},
3635
SET_TOP_COMMITS(state, topCommits) {
3736
state.topCommits = topCommits;

0 commit comments

Comments
 (0)