Notification: Set a new Friendship and Accepted Friendship

This commit is contained in:
Paolo Arena
2022-07-26 15:46:29 +02:00
parent e2006e683b
commit 43619ec719
15 changed files with 78 additions and 39 deletions

View File

@@ -29,10 +29,9 @@ export default defineComponent({
const myroutes = ref(<IListRoutes[]>[])
function getmenu(): any {
// console.log('getmenu menuOne!')
return globalStore.getmenu
}
const getmenu = computed(() => globalStore.getmenu )
const islogged = computed(() => userStore.isLogged)
function setParentVisibilityBasedOnRoute(parent: any) {
parent.routes.forEach((item: any) => {
@@ -42,19 +41,26 @@ export default defineComponent({
})
}
watch(() => userStore.isLogged || finishLoading.value,(to, from) => {
myroutes.value = []
myroutes.value = static_data.routes
})
watch(() => path, (to, from) => {
function updatemenu() {
const mymenu = globalStore.getmenu
// console.log('watch:', mymenu)
Object.keys(mymenu).forEach((parentName: any) => {
// console.log('parentName', parentName)
// @ts-ignore
setParentVisibilityBasedOnRoute(mymenu[parentName])
})
myroutes.value = []
myroutes.value = static_data.routes
}
watch(() => islogged.value,(to, from) => {
updatemenu()
})
watch(() => finishLoading.value,(to, from) => {
updatemenu()
})
watch(() => path, (to, from) => {
updatemenu()
})
/* function replaceUnderlineToSpace(text: string) {

View File

@@ -1,7 +1,7 @@
<template>
<div class="no-border" v-if="finishLoading">
<q-list class="rounded-borders text-primary">
<div v-for="ind1 in getmenu()" :key="ind1">
<div v-for="ind1 in getmenu" :key="ind1">
<!--<div class="q-list-header">{{replaceUnderlineToSpace(index)}}</div>-->
<div v-for="(myitemmenu, ind2) in myroutes" :key="ind2">
<div v-if="myitemmenu.active">

View File

@@ -66,11 +66,11 @@ export default defineComponent({
if (usernotifs.value) {
console.log('usernotifs.value', usernotifs.value, to)
const ret = await userStore.setUserNotifs(usernotifs.value)
if (ret) {
/*if (ret) {
tools.showPositiveNotif($q, t('db.recupdated'))
} else {
tools.showNegativeNotif($q, t('db.recfailed'))
}
}*/
}
})

View File

@@ -8,7 +8,7 @@
</q-btn>
<q-drawer v-model="open" side="right" elevated class="text-black">
<q-drawer v-model="open" side="right" elevated class="text-black" :width="350">
<q-bar class="bg-primary text-white">
{{ $t('notifs.notifs') }}
@@ -81,20 +81,20 @@
<q-item-section avatar>
<q-avatar>
<img :src="getImgByNotif(notif)" :alt="getUsernameChatByNotif(notif)">
<img :src="notif.myimgsender" :alt="notif.sender">
</q-avatar>
</q-item-section>
<q-item-section v-ripple @click="clickNotif(notif)">
<q-item-label lines="1" :class="(!notif.read) ? 'unread' : 'read'">{{ getNotifText(notif, false) }}</q-item-label>
<q-item-label caption lines="2" :class="(!notif.read) ? 'unread-date' : 'read-date'">
<q-item-label lines="3" :class="(!notif.read) ? 'unread' : 'read'"><div v-html="getNotifText(notif, false)"></div></q-item-label>
<q-item-label caption lines="1" :class="(!notif.read) ? 'unread-date' : 'read-date'">
{{ tools.timeAgo(notif.datenotif) }}
<!--{{ // getUsernameChatByNotif(notif) }}-->
</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label>
<q-btn rounded icon="fas fa-ellipsis-h">
<q-btn dense rounded icon="fas fa-ellipsis-h">
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup @click="notifStore.deleteRec(username, notif._id)">