@seamly/web-ui 22.3.0-beta.2 → 22.3.0

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.
@@ -12209,12 +12209,14 @@ class ConversationConnector {
12209
12209
  url: splittedUrl,
12210
12210
  params
12211
12211
  } = split_url_params(this.url);
12212
- this.socket = new Socket(splittedUrl, {
12213
- params: assign_default()(assign_default()({}, params), {
12214
- v: apiVersion
12215
- })
12216
- });
12217
- this.socket.connect();
12212
+ if (!this.socket) {
12213
+ this.socket = new Socket(splittedUrl, {
12214
+ params: assign_default()(assign_default()({}, params), {
12215
+ v: apiVersion
12216
+ })
12217
+ });
12218
+ this.socket.connect();
12219
+ }
12218
12220
  this.channel = this.socket.channel(this.channelTopic, {
12219
12221
  authorization: `Bearer ${this.accessToken}`,
12220
12222
  channelName: this.channelName
@@ -12279,8 +12281,6 @@ class ConversationConnector {
12279
12281
  ready: false,
12280
12282
  currentState: 'join_channel_erred'
12281
12283
  });
12282
- // @ts-ignore
12283
- this.channel.socket.disconnect();
12284
12284
  }).receive('timeout', () => {
12285
12285
  log('[CHANEL][JOIN] Networking issue. Still waiting...');
12286
12286
  });
@@ -12288,10 +12288,7 @@ class ConversationConnector {
12288
12288
  disconnect() {
12289
12289
  var _a;
12290
12290
  (_a = this.channel) === null || _a === void 0 ? void 0 : _a.leave().receive('ok', () => {
12291
- var _a, _b;
12292
12291
  log('[CHANNEL][LEAVE] OK');
12293
- (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remove(this.channel);
12294
- (_b = this.socket) === null || _b === void 0 ? void 0 : _b.disconnect();
12295
12292
  __classPrivateFieldSet(this, _ConversationConnector_connectionListeners, [], "f");
12296
12293
  });
12297
12294
  }
@@ -12862,7 +12859,7 @@ _API_ready = new (weak_map_default())(), _API_externalId = new (weak_map_default
12862
12859
  return {
12863
12860
  clientName: "@seamly/web-ui",
12864
12861
  clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
12865
- clientVersion: "22.3.0-beta.2",
12862
+ clientVersion: "22.3.0",
12866
12863
  currentUrl: window.location.toString(),
12867
12864
  screenResolution: `${window.screen.width}x${window.screen.height}`,
12868
12865
  timezone: getTimeZone(),
@@ -24615,22 +24612,26 @@ const SeamlyEventSubscriber = () => {
24615
24612
  }
24616
24613
  }, [api, api.connectionInfo, api.conversation.socket, dispatch]);
24617
24614
  (0,hooks_module/* useEffect */.d4)(() => {
24618
- api.conversation.onConnection(_ref => {
24619
- let {
24620
- currentState
24621
- } = _ref;
24622
- if (currentState === 'join_channel_erred') {
24623
- const seamlyGeneralError = new SeamlyGeneralError();
24624
- dispatch(setInterrupt({
24625
- name: seamlyGeneralError.name,
24626
- message: seamlyGeneralError.message,
24627
- langKey: seamlyGeneralError.langKey,
24628
- originalEvent: seamlyGeneralError.originalEvent,
24629
- originalError: seamlyGeneralError.originalError,
24630
- action: seamlyGeneralError.action
24631
- }));
24632
- }
24633
- });
24615
+ if (api.connectionInfo && api.conversation.socket) {
24616
+ api.conversation.onConnection(_ref => {
24617
+ let {
24618
+ currentState
24619
+ } = _ref;
24620
+ if (currentState === 'join_channel_erred') {
24621
+ const seamlyGeneralError = new SeamlyGeneralError();
24622
+ dispatch(setInterrupt({
24623
+ name: seamlyGeneralError.name,
24624
+ message: seamlyGeneralError.message,
24625
+ langKey: seamlyGeneralError.langKey,
24626
+ originalEvent: seamlyGeneralError.originalEvent,
24627
+ originalError: seamlyGeneralError.originalError,
24628
+ action: seamlyGeneralError.action
24629
+ }));
24630
+ return true;
24631
+ }
24632
+ return false;
24633
+ });
24634
+ }
24634
24635
  }, [api, api.connectionInfo, api.conversation.channel, dispatch]);
24635
24636
  (0,hooks_module/* useEffect */.d4)(() => {
24636
24637
  if (api.connectionInfo) {