diff --git a/components/school.riot b/components/school.riot index cedbb93..c883ea5 100644 --- a/components/school.riot +++ b/components/school.riot @@ -21,7 +21,7 @@ - + {etablissement.fields.g_ea_lib_vx} {etablissement.fields.ville_etab} {etablissement.fields.dep} @@ -43,12 +43,13 @@ return { onBeforeMount(props, state) { state = { - items: null + items: null, + breakCycle: false } }, onUpdated(props, state) { - if (!props.shouldShowInfos) return + if (!props.shouldShowInfos || state.breakCycle) return fetchEtablissement(props.course).then((response) => { response.forEach(etablissement => { // calcul la moyenne @@ -63,9 +64,11 @@ etablissement.fields.moyenne = ((pct_TBF*19)+(pct_TB*17)+(pct_B*15)+(pct_AB*13)+(pct_sansmention*11))/100 }) + state.breakCycle = true this.update({ items: response }) + state.breakCycle = false }) } }