check schedule if using admin settings

This commit is contained in:
Sharon Kennedy
2020-11-28 15:02:55 -05:00
parent c8c42e9086
commit dcd7718f8f
2 changed files with 46 additions and 8 deletions

View File

@@ -69,7 +69,7 @@ class ChatBox extends React.Component {
isMobile: true,
isSlowConnection: true,
decryptionErrors: {},
messagesInFlight: [],
messagesInFlight: []
}
this.state = this.initialState
this.chatboxInput = React.createRef();
@@ -587,14 +587,14 @@ class ChatBox extends React.Component {
}
componentDidMount() {
document.addEventListener("keydown", this.handleKeyDown, false);
document.addEventListener("keydown", this.handleKeyDown, false)
window.addEventListener('beforeunload', this.exitChat)
}
componentWillUnmount() {
document.removeEventListener("keydown", this.handleKeyDown, false);
document.removeEventListener("keydown", this.handleKeyDown, false)
window.removeEventListener('beforeunload', this.exitChat)
this.exitChat();
this.exitChat()
}
handleInputChange = e => {
@@ -655,7 +655,7 @@ class ChatBox extends React.Component {
}
render() {
if (!this.props.enabled) {
if (!this.props.enabled || !this.props.isAvailable) {
return null
}
@@ -788,7 +788,7 @@ ChatBox.propTypes = {
maxWaitTime: PropTypes.number,
waitInterval: PropTypes.number,
dockLabel: PropTypes.string,
enabled: PropTypes.bool,
enabled: PropTypes.bool
}
ChatBox.defaultProps = {