mirror of
https://github.com/Safe-Support-Chat/ocrcc-chatbox
synced 2024-11-22 02:34:55 +00:00
update admin app endpoint and ensure chatbox closes even if leaveRoom fails
This commit is contained in:
parent
40e968fcee
commit
bf29508e8c
10
dist/bookmarklet.js
vendored
10
dist/bookmarklet.js
vendored
File diff suppressed because one or more lines are too long
10
dist/chatbox.js
vendored
10
dist/chatbox.js
vendored
File diff suppressed because one or more lines are too long
2
dist/component.js
vendored
2
dist/component.js
vendored
File diff suppressed because one or more lines are too long
4
dist/index.html
vendored
4
dist/index.html
vendored
@ -13,10 +13,8 @@
|
||||
<script src="./chatbox.js"></script>
|
||||
<script>
|
||||
var config = {
|
||||
settingsEndpoint: 'https://safesupport-admin.herokuapp.com/api/get-settings',
|
||||
matrixServerUrl: 'https://matrix.safesupport.chat'
|
||||
}
|
||||
|
||||
};
|
||||
EmbeddableChatbox.mount(config);
|
||||
</script>
|
||||
|
||||
|
@ -151,6 +151,7 @@ class ChatBox extends React.Component {
|
||||
|
||||
exitChat = async (resetState=true) => {
|
||||
if (this.state.client) {
|
||||
try {
|
||||
await this.state.client.leave(this.state.roomId)
|
||||
|
||||
const auth = {
|
||||
@ -166,9 +167,13 @@ class ChatBox extends React.Component {
|
||||
await this.state.client.deactivateAccount(auth, true)
|
||||
await this.state.client.stopClient()
|
||||
await this.state.client.clearStores()
|
||||
} catch (err) {
|
||||
console.log("Error exiting chat", err)
|
||||
} finally {
|
||||
this.setState({ client: null, ready: true }) // no more loading animation
|
||||
window.clearInterval(this.state.waitIntervalId) // no more waiting messages
|
||||
}
|
||||
}
|
||||
|
||||
if (this.state.localStorage) {
|
||||
this.state.localStorage.clear()
|
||||
|
@ -1 +1 @@
|
||||
export const DEFAULT_SETTINGS_ENDPOINT = 'https://safesupport-admin.herokuapp.com/api/get-settings';
|
||||
export const DEFAULT_SETTINGS_ENDPOINT = 'https://admin.safesupport.chat/api/get-settings';
|
||||
|
Loading…
Reference in New Issue
Block a user