@seamly/web-ui 24.0.0-beta.2 → 24.0.0-beta.4

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.
@@ -4336,7 +4336,7 @@ class API {
4336
4336
  return {
4337
4337
  clientName: "@seamly/web-ui",
4338
4338
  clientVariant: this.#layoutMode,
4339
- clientVersion: "24.0.0-beta.2",
4339
+ clientVersion: "24.0.0-beta.4",
4340
4340
  currentUrl: window.location.toString(),
4341
4341
  screenResolution: `${window.screen.width}x${window.screen.height}`,
4342
4342
  timezone: getTimeZone(),
@@ -12981,7 +12981,8 @@ const useSeamlyChat = () => {
12981
12981
  (0,hooks_module/* useEffect */.vJ)(() => {
12982
12982
  // This is needed to reset the ref to allow connect and start to happen again.
12983
12983
  // Mostly due to Interrupt situations and a reset being called.
12984
- if (!apiConfigReady || !apiConnected) {
12984
+ // Only do this in case both are `false` (reset does this), because the websocket itself will automatically try to reconnect.
12985
+ if (!apiConfigReady && !apiConnected) {
12985
12986
  connectCalled.current = false;
12986
12987
  }
12987
12988
  }, [apiConfigReady, apiConnected]);
@@ -17142,28 +17143,6 @@ const SeamlyEventSubscriber = () => {
17142
17143
  const {
17143
17144
  emitEvent
17144
17145
  } = use_seamly_commands();
17145
- (0,hooks_module/* useEffect */.vJ)(() => {
17146
- if (conversation.socket) {
17147
- const {
17148
- onError,
17149
- onOpen
17150
- } = conversation;
17151
- onError(err => {
17152
- const seamlyOfflineError = new SeamlyOfflineError(err);
17153
- dispatch(setInterrupt({
17154
- name: seamlyOfflineError.name,
17155
- message: seamlyOfflineError.message,
17156
- langKey: seamlyOfflineError.langKey,
17157
- originalEvent: seamlyOfflineError.originalEvent,
17158
- originalError: seamlyOfflineError.originalError
17159
- }));
17160
- dispatch(clearEvents());
17161
- });
17162
- onOpen(() => {
17163
- dispatch(clearInterrupt());
17164
- });
17165
- }
17166
- }, [conversation, conversation.socket, dispatch]);
17167
17146
  (0,hooks_module/* useEffect */.vJ)(() => {
17168
17147
  if (conversation.socket) {
17169
17148
  conversation.onConnection(({
@@ -17183,6 +17162,20 @@ const SeamlyEventSubscriber = () => {
17183
17162
  }
17184
17163
  return false;
17185
17164
  });
17165
+ conversation.onError(err => {
17166
+ const seamlyOfflineError = new SeamlyOfflineError(err);
17167
+ dispatch(setInterrupt({
17168
+ name: seamlyOfflineError.name,
17169
+ message: seamlyOfflineError.message,
17170
+ langKey: seamlyOfflineError.langKey,
17171
+ originalEvent: seamlyOfflineError.originalEvent,
17172
+ originalError: seamlyOfflineError.originalError
17173
+ }));
17174
+ dispatch(clearEvents());
17175
+ });
17176
+ conversation.onOpen(() => {
17177
+ dispatch(clearInterrupt());
17178
+ });
17186
17179
  }
17187
17180
  }, [conversation, conversation.socket, dispatch]);
17188
17181
  (0,hooks_module/* useEffect */.vJ)(() => {