@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.
@@ -5680,7 +5680,8 @@ const useSeamlyChat = () => {
5680
5680
  (0,hooks_.useEffect)(() => {
5681
5681
  // This is needed to reset the ref to allow connect and start to happen again.
5682
5682
  // Mostly due to Interrupt situations and a reset being called.
5683
- if (!apiConfigReady || !apiConnected) {
5683
+ // Only do this in case both are `false` (reset does this), because the websocket itself will automatically try to reconnect.
5684
+ if (!apiConfigReady && !apiConnected) {
5684
5685
  connectCalled.current = false;
5685
5686
  }
5686
5687
  }, [apiConfigReady, apiConnected]);
@@ -14975,7 +14976,7 @@ class API {
14975
14976
  return {
14976
14977
  clientName: "@seamly/web-ui",
14977
14978
  clientVariant: this.#layoutMode,
14978
- clientVersion: "24.0.0-beta.2",
14979
+ clientVersion: "24.0.0-beta.4",
14979
14980
  currentUrl: window.location.toString(),
14980
14981
  screenResolution: `${window.screen.width}x${window.screen.height}`,
14981
14982
  timezone: getTimeZone(),
@@ -18119,28 +18120,6 @@ const SeamlyEventSubscriber = () => {
18119
18120
  const {
18120
18121
  emitEvent
18121
18122
  } = (0,seamly_hooks/* useSeamlyCommands */.Li)();
18122
- (0,hooks_.useEffect)(() => {
18123
- if (conversation.socket) {
18124
- const {
18125
- onError,
18126
- onOpen
18127
- } = conversation;
18128
- onError(err => {
18129
- const seamlyOfflineError = new seamly_offline_error/* default */.A(err);
18130
- dispatch((0,interrupt_slice/* setInterrupt */.y7)({
18131
- name: seamlyOfflineError.name,
18132
- message: seamlyOfflineError.message,
18133
- langKey: seamlyOfflineError.langKey,
18134
- originalEvent: seamlyOfflineError.originalEvent,
18135
- originalError: seamlyOfflineError.originalError
18136
- }));
18137
- dispatch((0,store_slice/* clearEvents */.lh)());
18138
- });
18139
- onOpen(() => {
18140
- dispatch((0,interrupt_slice/* clearInterrupt */.DB)());
18141
- });
18142
- }
18143
- }, [conversation, conversation.socket, dispatch]);
18144
18123
  (0,hooks_.useEffect)(() => {
18145
18124
  if (conversation.socket) {
18146
18125
  conversation.onConnection(({
@@ -18160,6 +18139,20 @@ const SeamlyEventSubscriber = () => {
18160
18139
  }
18161
18140
  return false;
18162
18141
  });
18142
+ conversation.onError(err => {
18143
+ const seamlyOfflineError = new seamly_offline_error/* default */.A(err);
18144
+ dispatch((0,interrupt_slice/* setInterrupt */.y7)({
18145
+ name: seamlyOfflineError.name,
18146
+ message: seamlyOfflineError.message,
18147
+ langKey: seamlyOfflineError.langKey,
18148
+ originalEvent: seamlyOfflineError.originalEvent,
18149
+ originalError: seamlyOfflineError.originalError
18150
+ }));
18151
+ dispatch((0,store_slice/* clearEvents */.lh)());
18152
+ });
18153
+ conversation.onOpen(() => {
18154
+ dispatch((0,interrupt_slice/* clearInterrupt */.DB)());
18155
+ });
18163
18156
  }
18164
18157
  }, [conversation, conversation.socket, dispatch]);
18165
18158
  (0,hooks_.useEffect)(() => {