Skip to content
Snippets Groups Projects
Commit 58a5a905 authored by DESPRES Damien's avatar DESPRES Damien
Browse files

hide buttons when offline

parent c8082671
No related branches found
No related tags found
No related merge requests found
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
<h4 id="les_projets" class="ui horizontal divider header">PROJETS</h4> <h4 id="les_projets" class="ui horizontal divider header">PROJETS</h4>
<div class="flex"> <div class="flex">
<router-link <router-link
v-if="user && user.can_create_project" v-if="user && user.can_create_project && isOffline()!=true"
:to="{ name: 'project_create', params: { action: 'create' } }" :to="{ name: 'project_create', params: { action: 'create' } }"
class="ui green basic button" class="ui green basic button"
> >
<i class="plus icon"></i> Créer un nouveau projet <i class="plus icon"></i> Créer un nouveau projet
</router-link> </router-link>
<router-link <router-link
v-if="user && user.can_create_project" v-if="user && user.can_create_project && isOffline()!=true"
:to="{ :to="{
name: 'project_type_list', name: 'project_type_list',
}" }"
...@@ -124,6 +124,9 @@ export default { ...@@ -124,6 +124,9 @@ export default {
}, },
methods: { methods: {
isOffline(){
return navigator.onLine==false;
},
refreshId() { refreshId() {
//* change path of thumbnail to update image //* change path of thumbnail to update image
return "?ver=" + Math.random(); return "?ver=" + Math.random();
......
...@@ -575,8 +575,11 @@ export default { ...@@ -575,8 +575,11 @@ export default {
})); }));
} }
}); });
Promise.all(promises).then(() => Promise.all(promises).then(() => {
this.updateLocalStorage() this.updateLocalStorage();
window.location.reload();
}
); );
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment