Better search for numbers + chat fix

This commit is contained in:
Adhiraj Singh
2020-11-15 14:05:32 +05:30
parent 11d1dda3f5
commit 2a01add13e
2 changed files with 4 additions and 4 deletions

View File

@@ -107,7 +107,7 @@ export class WAConnection extends Base {
const searchString = options.searchString?.toLowerCase()
const chats = this.chats.paginated (before, count, options && (chat => (
(typeof options?.custom !== 'function' || options?.custom(chat)) &&
(typeof searchString === 'undefined' || chat.name?.toLowerCase().includes (searchString) || chat.jid?.startsWith(searchString))
(typeof searchString === 'undefined' || chat.name?.toLowerCase().includes (searchString) || chat.jid?.includes(searchString))
)))
let loadPP = this.loadProfilePicturesForChatsAutomatically
if (typeof options.loadProfilePicture !== 'undefined') loadPP = options.loadProfilePicture