Skip to content

Commit

Permalink
Merge pull request Wolox#55 from Wolox/notify-store-change
Browse files Browse the repository at this point in the history
Notify store change
  • Loading branch information
Martín Callegari authored May 16, 2018
2 parents 3e1e7c5 + acda41c commit 3f86e60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
renderCustomComponent,
toggleWidget,
toggleInputDisabled,
dropMessages
dropMessages,
isWidgetOpened
} from './src/store/actions/dispatcher';

export {
Expand All @@ -17,5 +18,6 @@ export {
renderCustomComponent,
toggleWidget,
toggleInputDisabled,
dropMessages
dropMessages,
isWidgetOpened
};
1 change: 1 addition & 0 deletions src/components/Widget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Widget extends Component {
event.target.message.value = '';
}


render() {
return (
<WidgetLayout
Expand Down
4 changes: 4 additions & 0 deletions src/store/actions/dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ export function toggleInputDisabled() {
export function dropMessages() {
store.dispatch(actions.dropMessages());
}

export function isWidgetOpened() {
return store.getState().behavior.get('showChat');
}

0 comments on commit 3f86e60

Please sign in to comment.