Commit 6cf5091c authored by Renato Becker's avatar Renato Becker Committed by Tasso Evangelista

Add support for wss protocol based on Livechat URL. (#158)

parent 241b6bef
No preview for this file type
......@@ -8,3 +8,5 @@ const host = (
);
export const Livechat = new LivechatClient({ host, protocol: 'ddp' });
export const useSsl = host.match(/^https/) !== null;
import { Component } from 'preact';
import { Router, route } from 'preact-router';
import queryString from 'query-string';
import { Livechat } from '../../api';
import { Livechat, useSsl } from '../../api';
import history from '../../history';
import { loadConfig } from '../../lib/main';
import CustomFields from '../../lib/customFields';
......@@ -120,8 +120,7 @@ export class App extends Component {
async initialize() {
// TODO: split these behaviors into composable components
await Livechat.connect();
await Livechat.connect({ useSsl });
await loadConfig();
this.handleTriggers();
CustomFields.init();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment