versacall-core-library-react 2.0.73 → 2.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,21 +129,15 @@ class ChannelsProvider extends _react.Component {
129
129
  connected: true
130
130
  };
131
131
  const urlArray = props.core.baseUrl.split('://');
132
+ const protocol = urlArray[0]; // 'http' or 'https'
132
133
  const modifiedUrl = urlArray[urlArray.length - 1];
134
+ const isSecure = protocol === 'https';
135
+
136
+ // Use dynamic secure flag based on protocol
133
137
  client = emitter.connect({
134
138
  host: modifiedUrl,
135
139
  port: 9090,
136
- secure: true
137
- });
138
- client.on('connect', conack => {
139
- this.props.core.log('system', namespace, methodName, 'Emitter Connect', conack);
140
- if (this.state.connected === false) {
141
- this.resubscribeToChannels();
142
- this.setState({
143
- connected: true
144
- });
145
- notifyConnectionChanged(true);
146
- }
140
+ secure: isSecure // ws:// for http, wss:// for https
147
141
  });
148
142
  client.on('disconnect', () => {
149
143
  this.props.core.log('system', namespace, methodName, 'Emitter Disconnect');
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "versacall": {
3
3
  "title": "Versacall Core Library React",
4
4
  "applicationType": "react-library",
5
- "build": 73
5
+ "build": 74
6
6
  },
7
7
  "name": "versacall-core-library-react",
8
- "version": "2.0.73",
8
+ "version": "2.0.74",
9
9
  "description": "Versacall Core Library",
10
10
  "main": "dist/index.js",
11
11
  "module": "dist/index.js",