diff --git a/src/main.js b/src/main.js index 4bf957d27033d17d20e97b20b73a92e60d13335f..3b9bb6b8e077630ae2382f9dbcdb3cd6aa34df91 100644 --- a/src/main.js +++ b/src/main.js @@ -26,7 +26,7 @@ Vue.config.productionTip = false; // gestion mise à jour du serviceWorker et du precache var refreshing=false; -if(navigator.serviceWorker){ +if (navigator.serviceWorker) { navigator.serviceWorker.addEventListener('controllerchange', () => { // We'll also need to add 'refreshing' to our data originally set to false. if (refreshing) { @@ -44,7 +44,7 @@ const onConfigLoaded = function(config){ store.commit('SET_CONFIG', config); setInterval(() => { //* check if navigator is online store.commit('SET_IS_ONLINE', navigator.onLine); - }, 10000); + }, 5000); // set title and favico document.title = `${config.VUE_APP_APPLICATION_NAME} ${config.VUE_APP_APPLICATION_ABSTRACT}`; diff --git a/src/views/FeatureType/FeatureTypeDetail.vue b/src/views/FeatureType/FeatureTypeDetail.vue index 2c20b6c90632cacfd92a6942e2b0539e14cb7a9c..06b302ae1983a657f27122ef07ea442b8d111e6c 100644 --- a/src/views/FeatureType/FeatureTypeDetail.vue +++ b/src/views/FeatureType/FeatureTypeDetail.vue @@ -40,10 +40,12 @@ </div> </div> <div class="value"> - {{ features_count }} + {{ isOnline ? features_count : '?' }} </div> - <div class="label"> - Signalement{{ features.length > 1 ? "s" : "" }} + <div + class="label" + > + Signalement{{ features.length > 1 || !isOnline ? "s" : "" }} </div> </div> @@ -221,7 +223,10 @@ </div> </div> - <div class="nine wide column"> + <div + v-if="isOnline" + class="nine wide column" + > <h3 class="ui header"> Derniers signalements </h3> @@ -347,6 +352,19 @@ </router-link> <br> </div> + <div + v-else + class="nine wide column" + > + <h3 class="ui header"> + Derniers signalements + </h3> + <div class="ui message info"> + <p> + Information non disponible en mode déconnecté. + </p> + </div> + </div> </div> </div> </template>