mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
recei and clear the code
This commit is contained in:
@@ -121,7 +121,33 @@ export class ContactsPage implements OnInit {
|
||||
}
|
||||
|
||||
onChange(event) {
|
||||
const textSearch = event.detail.value;
|
||||
|
||||
const filteredUserList: (UserContacts & {isChecked: boolean})[] = this.FilterUserListedByTextSearch(textSearch) as any
|
||||
|
||||
const userContainer = {}
|
||||
for(const user of filteredUserList) {
|
||||
const firstLetter = user.wxFullName.charAt(0)
|
||||
if(!userContainer[firstLetter]) {
|
||||
userContainer[firstLetter] = [user]
|
||||
} else {
|
||||
userContainer[firstLetter].push(user)
|
||||
}
|
||||
}
|
||||
this.userContainer = userContainer
|
||||
}
|
||||
|
||||
|
||||
FilterUserListedByTextSearch(textSearch: string) {
|
||||
return this.allChatUsers.filter( e => e.wxFullName.toLowerCase().includes(textSearch.toLowerCase())).sort((a,b) => {
|
||||
if(a.wxFullName < b.wxFullName) {
|
||||
return -1;
|
||||
}
|
||||
if(a.wxFullName > b.wxFullName) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
clicked() {}
|
||||
|
||||
Reference in New Issue
Block a user