react-chat-widget icon indicating copy to clipboard operation
react-chat-widget copied to clipboard

Request - "typing" / loading indication

Open sahar922 opened this issue 6 years ago • 11 comments

hi guys, I think a method to render typing/loading indication will be great here. it'll make the chat process nicer.

Thanks!

sahar922 avatar Oct 11 '18 08:10 sahar922

Hi Sahar ! We've been working on this as a new feature. I think you already saw the pull request, but I'll leave the link here anyway

https://github.com/Wolox/react-chat-widget/pull/101#issue-246422184

Thanks!

Dorian30 avatar Jan 22 '19 16:01 Dorian30

I followed your example, but it didnt work. handleNewUserMessage = async newMessage => { toggleMsgLoader(); let { error, data } = await this.postChat(newMessage); if (!error) { toggleMsgLoader(); addResponseMessage(data.resposta); this.setState({ pergunta: newMessage, resposta: data.resposta }); } };

I get this error in console:

App.js:42 Uncaught (in promise) TypeError: Object(...) is not a function

Line 42 indicates the toggleMsgLoader function.

jkjunior avatar Feb 11 '19 13:02 jkjunior

Did you do an import statement before using the toggleMsgLoader function ?

Dorian30 avatar Feb 11 '19 18:02 Dorian30

Yes. import { Widget, addResponseMessage, toggleWidget, toggleMsgLoader } from "react-chat-widget";

jkjunior avatar Feb 12 '19 09:02 jkjunior

Including toggleMsgLoader through error.

Unhandled Rejection (TypeError): Object(...) is not a function. Any work around. Below is the snippet.

componentDidMount() {
toggleMsgLoader();
    setTimeout(() => {
      toggleMsgLoader();  
      console.log("Executed")
    }, 2000)
} 

ragu-swaminathan avatar Jun 12 '19 10:06 ragu-swaminathan

Same error here. Is there any solution for this?

dep-rcamussi avatar Jun 28 '19 21:06 dep-rcamussi

I have the same problem. It seem like the function toggleMsgLoader can't be found in the: ...\react-chat-widget\lib\index.js

Al0ngsy avatar Jul 02 '19 19:07 Al0ngsy

Ah of course the lastest release v2.1.4 is from 25 Jul 2018 didn't have toggleMsgLoader so importing it would lead to error msg.

We can only hope that this project is not abandoned and there will be a new release including all new stuff in near future.

Al0ngsy avatar Jul 02 '19 20:07 Al0ngsy

Hi all, importing and using toggleMsgLoader, works without error in v3.0.5, but it persists in the open conversation and the typing indicator does not disappear. The simplest usecase:

const handleNewUserMessage = (newMessage) => {
        console.log(newMessage);
        toggleMsgLoader();
        addResponseMessage('This is a test.');
    }
  • No error and the indicator appears in the chat window, but just stays there and does not disappear when "This is a test." is printed in chat window...

mintymike avatar Nov 06 '20 23:11 mintymike