|
|
@@ -17,11 +17,12 @@
|
|
|
</v-badge>
|
|
|
</v-btn>
|
|
|
|
|
|
- <v-tooltip :activator="btn" location="bottom">
|
|
|
+ <v-tooltip v-if="btn !== null" :activator="btn" location="bottom">
|
|
|
<span>{{ $t('notification') }}</span>
|
|
|
</v-tooltip>
|
|
|
|
|
|
<v-menu
|
|
|
+ v-if="btn !== null"
|
|
|
:activator="btn"
|
|
|
v-model="isOpen"
|
|
|
location="bottom left"
|
|
|
@@ -122,7 +123,6 @@ const query: ComputedRef<AnyJson> = computed(() => {
|
|
|
return { 'page': page.value }
|
|
|
})
|
|
|
|
|
|
-
|
|
|
let { data: collection, pending, refresh } = await fetchCollection(Notification, null, query)
|
|
|
|
|
|
/**
|
|
|
@@ -143,10 +143,10 @@ const unreadNotification: ComputedRef<Array<Notification>> = computed(() => {
|
|
|
* Les metadata dépendront de la dernière valeur du GET lancé
|
|
|
*/
|
|
|
const pagination: ComputedRef<Pagination> = computed(() => {
|
|
|
- return collection.value !== null ? collection.value.pagination : {}
|
|
|
+ return (!pending.value && collection.value !== null) ? collection.value.pagination : {}
|
|
|
})
|
|
|
|
|
|
-const notificationUrl = UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, 'notifications/list/')
|
|
|
+const notificationUrl = UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, '#/notifications/list/')
|
|
|
|
|
|
/**
|
|
|
* L'utilisateur a fait défiler le menu jusqu'à la dernière notification affichée
|
|
|
@@ -224,7 +224,7 @@ const markNotificationAsRead = (notification: Notification) => {
|
|
|
throw new Error('Current access id is null')
|
|
|
}
|
|
|
const notificationUsers = em.newInstance(NotificationUsers, {
|
|
|
- access:`/api/accesses/${accessProfileStore.id}`,
|
|
|
+ access:`/api/accesses/${accessProfileStore.switchId ?? accessProfileStore.id}`,
|
|
|
notification:`/api/notifications/${notification.id}`,
|
|
|
isRead: true
|
|
|
})
|