Просмотр исходного кода

improve the RefreshNeeded displaying behavior

Olivier Massot 6 месяцев назад
Родитель
Сommit
17c9dec203
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      components/Layout/Dialog/RefreshNeeded.vue

+ 6 - 2
components/Layout/Dialog/RefreshNeeded.vue

@@ -27,18 +27,22 @@ parce que le accessProfile a été modifié dans un autre onglet).
 <script setup lang="ts">
 import { useAccessProfileStore } from '~/stores/accessProfile'
 
-const showRefreshNeededDialog = ref(false)
+const accessProfileUpdated = ref(false)
 
 const accessProfileStore = useAccessProfileStore()
+const pageStore = usePageStore()
+
+const showRefreshNeededDialog = computed(() => accessProfileUpdated.value && !pageStore.loading)
 
 onMounted(() => {
   accessProfileStore.$subscribe(() => {
-    showRefreshNeededDialog.value = true
+    accessProfileUpdated.value = true
   })
 })
 
 
 const refreshPage = () => {
+  pageStore.loading = true
   window.location.reload()
 }
 </script>