Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Active state changed to chatting
Browse files Browse the repository at this point in the history
  • Loading branch information
knrt10 committed Jul 22, 2019
1 parent 04186a8 commit b1ad6b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ export class App extends Component {
await loadConfig();
await Livechat.connect();
locationUpdate();

this.handleTriggers();
CustomFields.init();
Hooks.init();
Expand Down
1 change: 0 additions & 1 deletion src/lib/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const api = {
Livechat.sendVisitorNavigation({ token, pageInfo: { change, title, location: { href } } });
return;
}


Livechat.sendVisitorNavigation({ token, rid: room._id, pageInfo: { change, title, location: { href } } });
},
Expand Down
5 changes: 3 additions & 2 deletions src/routes/Chat/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ export class ChatContainer extends Component {
const { alerts, dispatch, token, user } = this.props;
try {
this.stopTypingDebounced.stop();
store.setState({ userState: 'chatting' });
await Promise.all([
this.stopTyping({ rid, username: user.username }),
Livechat.changeUserState('chatting'),
Livechat.sendMessage({ msg, token, rid }),
]);
} catch (error) {
Expand All @@ -100,9 +102,8 @@ export class ChatContainer extends Component {
const alert = { id: createToken(), children: reason, error: true, timeout: 5000 };
await dispatch({ alerts: (alerts.push(alert), alerts) });
}
await Livechat.changeUserState('active');

await Livechat.notifyVisitorTyping(rid, user.username, false);
store.setState({ userState: 'active' });
}

doFileUpload = async(rid, file) => {
Expand Down

0 comments on commit b1ad6b9

Please sign in to comment.