Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a event for when the chatList filter changes #2511

Open
henriquecm opened this issue Nov 18, 2024 · 5 comments
Open

feat: Add a event for when the chatList filter changes #2511

henriquecm opened this issue Nov 18, 2024 · 5 comments
Labels
enhancement New feature or request needs triage

Comments

@henriquecm
Copy link

Is your feature request related to a problem? Please describe.
When using the WPP.chat.setChatList, I can try to keep track of what type of filter was applied, but if the user clear/change the Chat Filter using WhatsApp native filters I lose track of what filter is currently applied.

Describe the solution you'd like
An event that returns the current filter being applied.

Describe alternatives you've considered
Using a setInterval to check a __reactProps$ of an element that I found that has the current filter.

Additional context

@henriquecm henriquecm added enhancement New feature or request needs triage labels Nov 18, 2024
@dllsystem
Copy link

for now try using this function

WPP.whatsapp.Cmd.on('set_active_filter', (a) => {
console.log('event: set_active_filter', a)
})

to see existing events

window.require("WAWebCmd").Cmd._events

@icleitoncosta
Copy link
Contributor

for now try using this function

WPP.whatsapp.Cmd.on('set_active_filter', (a) => { console.log('event: set_active_filter', a) })

to see existing events

window.require("WAWebCmd").Cmd._events

Exact @dllsystem !

@icleitoncosta
Copy link
Contributor

Is your feature request related to a problem? Please describe. When using the WPP.chat.setChatList, I can try to keep track of what type of filter was applied, but if the user clear/change the Chat Filter using WhatsApp native filters I lose track of what filter is currently applied.

Describe the solution you'd like An event that returns the current filter being applied.

Describe alternatives you've considered Using a setInterval to check a __reactProps$ of an element that I found that has the current filter.

Additional context

I will working in new way to create custom lists. Whatsapp is releasing a new function for do, and I use it

@icleitoncosta
Copy link
Contributor

You can follow in #2517

@henriquecm
Copy link
Author

Thanks, I never used the WPP.whatsapp.Cmd before, I'll look into it, maybe I find new ways improve some others thing with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

3 participants