From 819d9b8ebbe6e55c699d00fa91ef6224c5c5327d Mon Sep 17 00:00:00 2001 From: Sharon Kennedy Date: Mon, 14 Dec 2020 17:37:26 -0500 Subject: [PATCH] cleanup --- README.md | 1 - src/components/ChatboxWithSettings.js | 2 +- src/components/chatbox.jsx | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index dff7dd6..e3e7643 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,6 @@ Options: | `chatOfflineMessage` (optional) | Text to show if there is no-one online respond | `All of the chat facilitators are currently offline.` | | `size` (optional) | The size of the start button. Can be 'small' or 'large' | `large` | | `position` (optional) | The position of the start button. Can be 'top left', 'top right', 'bottom left', 'bottom right'. | `bottom right` | -| `maxWaitTime` (optional) | The maximum time (in ms) the chatbox will wait for someone to join before closing the chat and displaying the chat unavailable message | 600000 | | `waitInterval` (optional) | The interval (in ms) at which the bot sends the wait message | 120000 | diff --git a/src/components/ChatboxWithSettings.js b/src/components/ChatboxWithSettings.js index 5cb6549..a2af4aa 100644 --- a/src/components/ChatboxWithSettings.js +++ b/src/components/ChatboxWithSettings.js @@ -7,7 +7,6 @@ const ChatboxWithSettings = ({ settingsEndpoint, matrixServerUrl, ...rest }) => const [settings, setSettings] = useState({}); const [shifts, setShifts] = useState(); const [isAvailable, setAvailability] = useState(false); - const settingsObj = {}; const getSettings = async () => { if (!settingsEndpoint) { @@ -24,6 +23,7 @@ const ChatboxWithSettings = ({ settingsEndpoint, matrixServerUrl, ...rest }) => const res = await fetch(url); const data = await res.json(); const { fields, schedule = [] } = data; + const settingsObj = {}; setShifts(schedule); diff --git a/src/components/chatbox.jsx b/src/components/chatbox.jsx index 403a6b0..aa958de 100644 --- a/src/components/chatbox.jsx +++ b/src/components/chatbox.jsx @@ -41,7 +41,6 @@ const DEFAULT_WAIT_MESSAGE = "Please be patient, our online facilitators are cur const DEFAULT_ENCRYPTION_DISABLED = false const DEFAULT_POSITION = 'bottom right' const DEFAULT_SIZE = 'large' -const DEFAULT_MAX_WAIT_MS = 600000 // 10 minutes const DEFAULT_WAIT_INTERVAL_MS = 120000 // 2 minutes const DEFAULT_DOCK_LABEL = 'Start a new chat' const DEFAULT_ENABLED = false @@ -785,7 +784,6 @@ ChatBox.propTypes = { isEncryptionDisabled: PropTypes.bool, position: PropTypes.oneOf(['top left', 'top right', 'bottom left', 'bottom right']), size: PropTypes.oneOf(['small', 'large']), - maxWaitTime: PropTypes.number, waitInterval: PropTypes.number, dockLabel: PropTypes.string, enabled: PropTypes.bool @@ -807,7 +805,6 @@ ChatBox.defaultProps = { isEncryptionDisabled: DEFAULT_ENCRYPTION_DISABLED, position: DEFAULT_POSITION, size: DEFAULT_SIZE, - maxWaitTime: DEFAULT_MAX_WAIT_MS, waitInterval: DEFAULT_WAIT_INTERVAL_MS, dockLabel: DEFAULT_DOCK_LABEL, enabled: DEFAULT_ENABLED,