Commit 38fb86e0 authored by Renato Becker's avatar Renato Becker Committed by Tasso Evangelista

Defining ws/wss protocol on constructor class instead of on connecting (#159)

* Add support for wss protocol based on Livechat URL.

* Defining the useSsl parameter on LivechatClient constructor instead of on connecting.

* .

* Removed invalid blank line.
parent 6cf5091c
No preview for this file type
......@@ -7,6 +7,6 @@ const host = (
(process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : null)
);
export const Livechat = new LivechatClient({ host, protocol: 'ddp' });
const useSsl = host.match(/^https/) !== null;
export const useSsl = host.match(/^https/) !== null;
export const Livechat = new LivechatClient({ host, protocol: 'ddp', useSsl });
import { Component } from 'preact';
import { Router, route } from 'preact-router';
import queryString from 'query-string';
import { Livechat, useSsl } from '../../api';
import { Livechat } from '../../api';
import history from '../../history';
import { loadConfig } from '../../lib/main';
import CustomFields from '../../lib/customFields';
......@@ -120,7 +120,7 @@ export class App extends Component {
async initialize() {
// TODO: split these behaviors into composable components
await Livechat.connect({ useSsl });
await Livechat.connect();
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