File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ export default {
42
42
},
43
43
methods: {
44
44
viewOrg (name ) {
45
- this .$router .push ({ name: " orgView" , params: { name: name } });
45
+ if (this .$store .state .isOrgLoaded [name])
46
+ this .$router .push ({ name: " orgView" , params: { name: name } });
46
47
}
47
48
}
48
49
};
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ export default {
41
41
},
42
42
methods: {
43
43
async load (cutoff ) {
44
+ // Set org status as loading
45
+ this .$store .commit (" SET_ORG_STATUS" , {orgName: this .orgName , status: false })
46
+
44
47
let topContributors = [];
45
48
const orgRepos = await this .getRepos ();
46
49
@@ -89,6 +92,7 @@ export default {
89
92
cutoff-- ;
90
93
}
91
94
this .isLoading = false ;
95
+ this .$store .commit (" SET_ORG_STATUS" , {orgName: this .orgName , status: true });
92
96
},
93
97
async getRepos () {
94
98
const res = await axios
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ export default new Vuex.Store({
17
17
topCommits : [ ] ,
18
18
topWeekCommits : [ ] ,
19
19
topMonthCommits : [ ] ,
20
- topYearCommits : [ ]
20
+ topYearCommits : [ ] ,
21
+ isOrgLoaded : [ ]
21
22
} ,
22
23
mutations : {
23
24
SET_USER ( state , user ) {
@@ -43,6 +44,9 @@ export default new Vuex.Store({
43
44
} ,
44
45
SET_TOP_YEAR_COMMITS ( state , topYearCommits ) {
45
46
state . topYearCommits = topYearCommits ;
47
+ } ,
48
+ SET_ORG_STATUS ( state , payload ) {
49
+ state . isOrgLoaded [ payload . orgName ] = payload . status ;
46
50
}
47
51
} ,
48
52
actions : {
You can’t perform that action at this time.
0 commit comments