pusher / chatkit-client-js

JavaScript client SDK for Pusher Chatkit
https://pusher.com/chatkit
MIT License
90 stars 15 forks source link

seems a bug in "userStartedTyping: (user)", "user" returning room data instead of user #36

Closed themodernpk closed 6 years ago

themodernpk commented 6 years ago
chatManager.connect({
    delegate: {
        userStartedTyping: (user) => {
            //user should have data of the user who is 
            //currently type instead it has data of the room
            console.log(`User ${user.name} started typing in room`);

        }
    },
});

Here are the screenshots to help: https://i.imgur.com/J6Y62Hj.png https://i.imgur.com/leIJjyW.png

Let me know if you can help

alexey13 commented 6 years ago

Dont see room in your code. But it should be. chatManager.connect({ delegate: { userStartedTyping: (room, user) => { console.log(User ${user.name} started typing); }

themodernpk commented 6 years ago

@alexey13 I was referring to your documentation https://i.imgur.com/2S3T5nO.png

alexey13 commented 6 years ago

You used it in wrong place. With room in ChatManagerDelegate. Without room in RoomDelegate

https://docs.pusher.com/chatkit/reference/javascript#receiving-typing-indicator-events https://docs.pusher.com/chatkit/reference/javascript#chatmanagerdelegate

themodernpk commented 6 years ago

Oh okay, got it. Thanks. Although, I still feel the documents is complicated & sometimes confusing.