Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcardeenas authored Apr 10, 2020
1 parent 757afb0 commit 7638884
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,15 @@ There are some tricks for a better usage of sulla.
```javascript
// In case of being logged out of whatsapp web
// Force it to keep the current session
// State change
client.onStateChange((state) => {
if (state === 'UNLAUNCHED') {
console.log(state);
const conflits = [
sulla.SocketState.CONFLICT,
sulla.SocketState.UNPAIRED,
sulla.SocketState.UNLAUNCHED,
];
if (conflits.includes(state)) {
client.useHere();
}
});
Expand Down

0 comments on commit 7638884

Please sign in to comment.