+ Registered Users
+ UsersList Online
This commit is contained in:
@@ -65,6 +65,7 @@ export const tools = {
|
||||
FILTER_MYFOLLOW: 2,
|
||||
|
||||
COOK_SEARCH: 'SEARCH_',
|
||||
COOK_TAB_CIRCUIT: 'TAB_CIRC',
|
||||
|
||||
FRIENDS_SEARCH: 'FR_SE',
|
||||
GROUP_SEARCH: 'GR_SE',
|
||||
@@ -2768,6 +2769,7 @@ export const tools = {
|
||||
// Metti come default
|
||||
userStore.setlang($q, $router, mylang)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!mylang) {
|
||||
@@ -3612,6 +3614,11 @@ export const tools = {
|
||||
return date.addToDate(mydate, { days })
|
||||
},
|
||||
|
||||
isUserOnline(user: IUserFields) {
|
||||
const dateonline = tools.addDays(tools.getDateNow(), -1)
|
||||
return user.lasttimeonline && new Date(user.lasttimeonline).getTime() > dateonline.getTime()
|
||||
},
|
||||
|
||||
addMinutes(mydate: Date, minutes: number) {
|
||||
return date.addToDate(mydate, { minutes })
|
||||
},
|
||||
@@ -7337,6 +7344,23 @@ export const tools = {
|
||||
return ''
|
||||
},
|
||||
|
||||
getNameToShow(user: IUserFields): string {
|
||||
const userStore = useUserStore()
|
||||
|
||||
let name = userStore.getNameToShow(user)
|
||||
|
||||
return name
|
||||
},
|
||||
|
||||
getUserNameOnlyIfToShow(user: IUserFields): string {
|
||||
const userStore = useUserStore()
|
||||
|
||||
let name = userStore.getUserNameOnlyIfToShow(user)
|
||||
|
||||
return name
|
||||
},
|
||||
|
||||
|
||||
getoptionsMainCards(only: boolean) {
|
||||
let myarr = []
|
||||
let obj = { label: '', value: '', icon: '' }
|
||||
|
||||
@@ -273,7 +273,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return (trovato) || null
|
||||
},
|
||||
|
||||
|
||||
getImgByUsername(username: string): string {
|
||||
if (username === '') return ''
|
||||
// Check if is this User!
|
||||
@@ -441,6 +440,15 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return name
|
||||
},
|
||||
|
||||
getUserNameOnlyIfToShow(user: IUserFields): string {
|
||||
|
||||
if (user.name || user.surname) {
|
||||
return user.username
|
||||
}
|
||||
|
||||
return ''
|
||||
},
|
||||
|
||||
getUserByUserId(userId: string): IUserFields | null {
|
||||
// Check if is this User!
|
||||
if (this.my._id === userId) return this.my
|
||||
|
||||
Reference in New Issue
Block a user