How to use the @cometchat-pro/chat.CometChat.TypingIndicator function in @cometchat-pro/chat

To help you get started, we’ve selected a few @cometchat-pro/chat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cometchat-pro-samples / javascript-reactjs-chat-app / src / components / cometchat / ChatBody.jsx View on Github external
let receiverType = CometChat.RECEIVER_TYPE.USER;

      let typingNotification = new CometChat.TypingIndicator(
        receiverId,
        receiverType
      );

      if (e.target.value === "") CometChat.endTyping(typingNotification);
      else CometChat.startTyping(typingNotification);
    } else if (this.props.activeConversation.guid !== undefined) {
      let receiverId = this.props.activeConversation.guid;

      let receiverType = CometChat.RECEIVER_TYPE.GROUP;

      let typingNotification = new CometChat.TypingIndicator(
        receiverId,
        receiverType
      );

      if (e.target.value === "") CometChat.endTyping(typingNotification);
      else CometChat.startTyping(typingNotification);
    }
  };
github cometchat-pro-samples / javascript-reactjs-chat-app / src / js / components / message / CCMessageFooter.js View on Github external
endTyping=()=>{
    if(this.props.activeMessageType == "user"){
      let receiverId =  this.props.activeUser;
      let receiverType = CometChat.RECEIVER_TYPE.USER;
      let metadata = {
        text : ""
      };
      let typingNotification = new CometChat.TypingIndicator(receiverId,receiverType,metadata);
      CometChat.endTyping(typingNotification);
    }
  }
github cometchat-pro-samples / javascript-reactjs-chat-app / src / js / components / message / CCMessageFooter.js View on Github external
startTyping=(content)=>{
    if(this.props.activeMessageType == "user"){
      let receiverId =  this.props.activeUser;
      let receiverType = CometChat.RECEIVER_TYPE.USER;
      let metadata = {
        text : content
      };
      let typingNotification = new CometChat.TypingIndicator(receiverId,receiverType,metadata);
      CometChat.startTyping(typingNotification);
    }
  }
github cometchat-pro-samples / javascript-reactjs-chat-app / src / components / cometchat / ChatBody.jsx View on Github external
handleTextInputChange = e => {
    this.setState({ newMessage: e.target.value });

    if (this.props.activeConversation.uid !== undefined) {
      let receiverId = this.props.activeConversation.uid;

      let receiverType = CometChat.RECEIVER_TYPE.USER;

      let typingNotification = new CometChat.TypingIndicator(
        receiverId,
        receiverType
      );

      if (e.target.value === "") CometChat.endTyping(typingNotification);
      else CometChat.startTyping(typingNotification);
    } else if (this.props.activeConversation.guid !== undefined) {
      let receiverId = this.props.activeConversation.guid;

      let receiverType = CometChat.RECEIVER_TYPE.GROUP;

      let typingNotification = new CometChat.TypingIndicator(
        receiverId,
        receiverType
      );