add parameters

This commit is contained in:
Peter Maquiran
2023-08-20 00:26:24 +01:00
parent 8d35abbdd0
commit 6d8e0123b7
18 changed files with 193 additions and 77 deletions
@@ -32,6 +32,10 @@ export class GroupContactsPage implements OnInit {
groupName:string;
selectedUserList:any;
sessionStore = SessionStore
objectUserSingleStone = []
userContainer = {}
constructor(
private modalController: ModalController,
@@ -81,6 +85,30 @@ export class GroupContactsPage implements OnInit {
}
return 0;
});
for( const user of this.users) {
const foundUser = this.objectUserSingleStone.find( e => e.name == user.name)
if(!foundUser) {
this.objectUserSingleStone.push(user)
}
}
for(const user of this.objectUserSingleStone) {
const firstLetter = user.name.charAt(0)
if(!this.userContainer[firstLetter]) {
this.userContainer[firstLetter] = [user]
} else {
this.userContainer[firstLetter].push(user)
}
}
this.showLoader = false;
@@ -178,6 +206,26 @@ export class GroupContactsPage implements OnInit {
})
this.users = users
let a = this.objectUserSingleStone.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase()))
let b = {}
for(const user of a) {
const firstLetter = user.name.charAt(0)
if(!b[firstLetter]) {
b[firstLetter] = [user]
} else {
b[firstLetter].push(user)
}
}
this.userContainer = b
}
@@ -185,9 +233,16 @@ export class GroupContactsPage implements OnInit {
}
selectedContact(user:any){
/* this.groupName = this.room.name; */
user.isChecked = !user.isChecked;
selectedContact(user:any) {
/* this.groupName = this.room.name; */
if(user.isChecked != true ) {
user.isChecked = false
} else {
user.isChecked = true
}
const userIndex = this.objectUserSingleStone.findIndex((e) => e._id == user._id)
this.objectUserSingleStone[userIndex].isChecked = user.isChecked
}