phone-a-friend
phone-a-friend copied to clipboard
Make sure there aren't any other clients connected
When a client closes their tab, it informs the worker that the client has disconnected. Right now it will immediately reset the readyPromise in messenger.js to say that the client is no longer ready to accept messages. But if the user has multiple tabs open this could be problematic since there really could be another tab open able to accept messages. messenger.js#clientReadyStateChange should check to see if there are still clients available before reseting the readyPromise.