How to use the @cometchat-pro/chat.CometChat.ConversationsRequestBuilder 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 / Conversations.jsx View on Github external
componentDidUpdate(prevProps) {
    if (
      (_.isEmpty(this.state.conversations) &&
        this.state.conversationsFetched === false) ||
        (this.props.lastMessageId !== prevProps.lastMessageId)
    ) {
      var conversationsRequest = new CometChat.ConversationsRequestBuilder()
        .setLimit(50)
        .build();

        conversationsRequest.fetchNext().then(
            conversationList => {
           
              this.setState({
                conversations: conversationList,
                conversationsFetched: true
              });
          
        },
        error => {
           
          this.setState({
            conversations: [],
github cometchat-pro-samples / javascript-reactjs-chat-app / src / components / cometchat / Conversations.jsx View on Github external
handleSearchStringChange = e => {

    this.setState({ searchString: e.target.value });

    let search_string =  e.target.value;

    var conversationsRequest = new CometChat.ConversationsRequestBuilder()
        .setLimit(100)
        .build();

        conversationsRequest.fetchNext().then(
          
            conversationList => {
           
              let keys_to_remove = [];

              if(conversationList.length > 0)
              {
                _.forEach(conversationList, function(c,k) { 
                  
                  if(_.toLower(c.conversationWith.name).indexOf(_.toLower(search_string)) < 0)
                  {
                    keys_to_remove = _.concat(keys_to_remove, k);