Conto Comunitario...
This commit is contained in:
@@ -17,6 +17,14 @@ export const costanti = {
|
||||
CERCO: 2,
|
||||
},
|
||||
|
||||
ENABLE_FRIENDS: false,
|
||||
ENABLE_CONTI_COMUNITARI: true,
|
||||
|
||||
AccountType: {
|
||||
USER: 0,
|
||||
COMMUNITY_ACCOUNT: 1,
|
||||
},
|
||||
|
||||
Lang: {
|
||||
IT: 1,
|
||||
EN: 2,
|
||||
|
||||
@@ -6543,6 +6543,31 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
getGroupsWhereIAmTheAdminOfTheCircuit(name: string, username: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
let arr: any[] = []
|
||||
|
||||
let risultato = false
|
||||
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
const ris = userStore.my.profile.manage_mycircuits.find((circuit: ICircuit) => {
|
||||
if (circuit.name === name) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
// console.log('ris', ris)
|
||||
if (ris && ris.admins) {
|
||||
const isadmin = ris.admins.find((user: IFriends) => user.username === username)
|
||||
risultato = !!isadmin
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return arr
|
||||
|
||||
},
|
||||
|
||||
setCmd($q: any, cmd: number, username: string, value: any, dest: string) {
|
||||
console.log('setcmd', cmd)
|
||||
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {
|
||||
|
||||
@@ -244,20 +244,8 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return false
|
||||
},
|
||||
|
||||
GroupsListWhereIAmAdmin(username: string): string[] {
|
||||
let myarr: any[] = []
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (this.my.profile && globalStore.mygroups) {
|
||||
myarr = globalStore.mygroups.filter((mygroup: IMyGroup) => {
|
||||
if (mygroup.admins && mygroup.admins.findIndex((useradmin: IUserAdmins) => useradmin.username === username) >= 0) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
return myarr
|
||||
GroupsListWhereIAmAdmin(): IMyGroup[] {
|
||||
return this.my.profile.manage_mygroups
|
||||
},
|
||||
|
||||
IsAskedFriendByUsername(username: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user