From 763888442f27aab06c195907b309b66626c25fa4 Mon Sep 17 00:00:00 2001 From: Daniel Cardenas Date: Fri, 10 Apr 2020 09:46:52 -0500 Subject: [PATCH] Update README.md --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eece7fd7..df016348 100644 --- a/README.md +++ b/README.md @@ -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(); } });