question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onStateChanged not working

See original GitHub issue

Description

onStateChanged not working .

Environment

Venom version(s): e.g. 4.0.4
Browser: Chromium 938248
OS: Windows 10 Pro (WSL: Ubuntu)
Node version: Node 14.8.2 (I also tested with node 17+ and node 8.x)

Your Code

this.whatsapp.onStateChange((state) => {
			 console.log('State changed: ', state);
			// force whatsapp take over
			if ('CONFLICT'.includes(state)) {
				//this.whatsapp.useHere();
				process.exit(1)
			}
			// detect disconnect on whatsapp
			if ('UNPAIRED'.includes(state)) {
				console.log('logout');
				process.exit(1)
			}
		});

Additional context / Screenshot

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
lukasportalcommented, Jan 31, 2022

the WAPI code is listening to state change window.Store.State.default.on... but instead it should use window.Store.State.Socket.on...

0reactions
warklpcommented, Aug 15, 2022

Same problem here

Read more comments on GitHub >

github_iconTop Results From Across the Web

onStateChanged not working · Issue #910 - GitHub
i built an app to listen to some values on HTML file but first you should listen to onStateChanged function but this Stream...
Read more >
Flutter Webview onStateChanged is not getting triggered
When i changed this part of the code it started working. Now i need to figure out why: final flutterWebviewPlugin = new ...
Read more >
onStateChanged - Mozilla - MDN Web Docs
onStateChanged. Fires when the captive portal state changes. ... onStateChanged. ... Report problems with this compatibility data on GitHub ...
Read more >
LifecycleEventObserver - Android Developers
abstract void onStateChanged( @NonNull LifecycleOwner source, @NonNull Lifecycle.Event event ). Called when a state transition event happens.
Read more >
Scripting API: CullingGroup.onStateChanged - Unity - Manual
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found