@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.
@@ -4003,7 +4003,7 @@ class API {
4003
4003
  return {
4004
4004
  clientName: "@seamly/web-ui",
4005
4005
  clientVariant: this.#layoutMode,
4006
- clientVersion: "24.0.0-beta.2",
4006
+ clientVersion: "24.0.0-beta.4",
4007
4007
  currentUrl: window.location.toString(),
4008
4008
  screenResolution: `${window.screen.width}x${window.screen.height}`,
4009
4009
  timezone: getTimeZone(),
@@ -12648,7 +12648,8 @@ const useSeamlyChat = () => {
12648
12648
  (0,hooks_.useEffect)(() => {
12649
12649
  // This is needed to reset the ref to allow connect and start to happen again.
12650
12650
  // Mostly due to Interrupt situations and a reset being called.
12651
- if (!apiConfigReady || !apiConnected) {
12651
+ // Only do this in case both are `false` (reset does this), because the websocket itself will automatically try to reconnect.
12652
+ if (!apiConfigReady && !apiConnected) {
12652
12653
  connectCalled.current = false;
12653
12654
  }
12654
12655
  }, [apiConfigReady, apiConnected]);
@@ -16809,28 +16810,6 @@ const SeamlyEventSubscriber = () => {
16809
16810
  const {
16810
16811
  emitEvent
16811
16812
  } = use_seamly_commands();
16812
- (0,hooks_.useEffect)(() => {
16813
- if (conversation.socket) {
16814
- const {
16815
- onError,
16816
- onOpen
16817
- } = conversation;
16818
- onError(err => {
16819
- const seamlyOfflineError = new SeamlyOfflineError(err);
16820
- dispatch(setInterrupt({
16821
- name: seamlyOfflineError.name,
16822
- message: seamlyOfflineError.message,
16823
- langKey: seamlyOfflineError.langKey,
16824
- originalEvent: seamlyOfflineError.originalEvent,
16825
- originalError: seamlyOfflineError.originalError
16826
- }));
16827
- dispatch(clearEvents());
16828
- });
16829
- onOpen(() => {
16830
- dispatch(clearInterrupt());
16831
- });
16832
- }
16833
- }, [conversation, conversation.socket, dispatch]);
16834
16813
  (0,hooks_.useEffect)(() => {
16835
16814
  if (conversation.socket) {
16836
16815
  conversation.onConnection(({
@@ -16850,6 +16829,20 @@ const SeamlyEventSubscriber = () => {
16850
16829
  }
16851
16830
  return false;
16852
16831
  });
16832
+ conversation.onError(err => {
16833
+ const seamlyOfflineError = new SeamlyOfflineError(err);
16834
+ dispatch(setInterrupt({
16835
+ name: seamlyOfflineError.name,
16836
+ message: seamlyOfflineError.message,
16837
+ langKey: seamlyOfflineError.langKey,
16838
+ originalEvent: seamlyOfflineError.originalEvent,
16839
+ originalError: seamlyOfflineError.originalError
16840
+ }));
16841
+ dispatch(clearEvents());
16842
+ });
16843
+ conversation.onOpen(() => {
16844
+ dispatch(clearInterrupt());
16845
+ });
16853
16846
  }
16854
16847
  }, [conversation, conversation.socket, dispatch]);
16855
16848
  (0,hooks_.useEffect)(() => {