@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.
@@ -11531,12 +11531,14 @@ class ConversationConnector {
11531
11531
  url: splittedUrl,
11532
11532
  params
11533
11533
  } = split_url_params(this.url);
11534
- this.socket = new Socket(splittedUrl, {
11535
- params: Object.assign(Object.assign({}, params), {
11536
- v: javascripts_config/* apiVersion */.tW
11537
- })
11538
- });
11539
- this.socket.connect();
11534
+ if (!this.socket) {
11535
+ this.socket = new Socket(splittedUrl, {
11536
+ params: Object.assign(Object.assign({}, params), {
11537
+ v: javascripts_config/* apiVersion */.tW
11538
+ })
11539
+ });
11540
+ this.socket.connect();
11541
+ }
11540
11542
  this.channel = this.socket.channel(this.channelTopic, {
11541
11543
  authorization: `Bearer ${this.accessToken}`,
11542
11544
  channelName: this.channelName
@@ -11601,8 +11603,6 @@ class ConversationConnector {
11601
11603
  ready: false,
11602
11604
  currentState: 'join_channel_erred'
11603
11605
  });
11604
- // @ts-ignore
11605
- this.channel.socket.disconnect();
11606
11606
  }).receive('timeout', () => {
11607
11607
  log('[CHANEL][JOIN] Networking issue. Still waiting...');
11608
11608
  });
@@ -11610,10 +11610,7 @@ class ConversationConnector {
11610
11610
  disconnect() {
11611
11611
  var _a;
11612
11612
  (_a = this.channel) === null || _a === void 0 ? void 0 : _a.leave().receive('ok', () => {
11613
- var _a, _b;
11614
11613
  log('[CHANNEL][LEAVE] OK');
11615
- (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remove(this.channel);
11616
- (_b = this.socket) === null || _b === void 0 ? void 0 : _b.disconnect();
11617
11614
  __classPrivateFieldSet(this, _ConversationConnector_connectionListeners, [], "f");
11618
11615
  });
11619
11616
  }
@@ -12155,7 +12152,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_conversationAu
12155
12152
  return {
12156
12153
  clientName: "@seamly/web-ui",
12157
12154
  clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
12158
- clientVersion: "22.3.0-beta.2",
12155
+ clientVersion: "22.3.0",
12159
12156
  currentUrl: window.location.toString(),
12160
12157
  screenResolution: `${window.screen.width}x${window.screen.height}`,
12161
12158
  timezone: getTimeZone(),
@@ -15267,21 +15264,25 @@ const SeamlyEventSubscriber = () => {
15267
15264
  }
15268
15265
  }, [api, api.connectionInfo, api.conversation.socket, dispatch]);
15269
15266
  (0,hooks_.useEffect)(() => {
15270
- api.conversation.onConnection(({
15271
- currentState
15272
- }) => {
15273
- if (currentState === 'join_channel_erred') {
15274
- const seamlyGeneralError = new seamly_general_error/* default */.Z();
15275
- dispatch((0,interrupt_slice/* setInterrupt */.uc)({
15276
- name: seamlyGeneralError.name,
15277
- message: seamlyGeneralError.message,
15278
- langKey: seamlyGeneralError.langKey,
15279
- originalEvent: seamlyGeneralError.originalEvent,
15280
- originalError: seamlyGeneralError.originalError,
15281
- action: seamlyGeneralError.action
15282
- }));
15283
- }
15284
- });
15267
+ if (api.connectionInfo && api.conversation.socket) {
15268
+ api.conversation.onConnection(({
15269
+ currentState
15270
+ }) => {
15271
+ if (currentState === 'join_channel_erred') {
15272
+ const seamlyGeneralError = new seamly_general_error/* default */.Z();
15273
+ dispatch((0,interrupt_slice/* setInterrupt */.uc)({
15274
+ name: seamlyGeneralError.name,
15275
+ message: seamlyGeneralError.message,
15276
+ langKey: seamlyGeneralError.langKey,
15277
+ originalEvent: seamlyGeneralError.originalEvent,
15278
+ originalError: seamlyGeneralError.originalError,
15279
+ action: seamlyGeneralError.action
15280
+ }));
15281
+ return true;
15282
+ }
15283
+ return false;
15284
+ });
15285
+ }
15285
15286
  }, [api, api.connectionInfo, api.conversation.channel, dispatch]);
15286
15287
  (0,hooks_.useEffect)(() => {
15287
15288
  if (api.connectionInfo) {