@sanity/client 6.18.0-canary.0 → 6.18.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.
@@ -904,7 +904,7 @@ function _listen(query, params, opts = {}) {
904
904
  }
905
905
  function open() {
906
906
  getEventSource().then((eventSource) => {
907
- eventSource && (es = eventSource, unsubscribed && unsubscribe());
907
+ eventSource && (es = eventSource);
908
908
  }).catch((reason) => {
909
909
  observer.error(reason), stop();
910
910
  });
@@ -951,13 +951,10 @@ class LiveClient {
951
951
  open();
952
952
  function onError(evt) {
953
953
  if (!stopped) {
954
- if ("data" in evt)
955
- try {
956
- const event = parseEvent(evt);
957
- observer.error(new Error(event.message, { cause: event }));
958
- } catch (err) {
959
- observer.error(err);
960
- }
954
+ if ("data" in evt) {
955
+ const event = parseEvent(evt);
956
+ observer.error(new Error(event.message, { cause: event }));
957
+ }
961
958
  es.readyState === es.CLOSED && (unsubscribe(), clearTimeout(reconnectTimer), reconnectTimer = setTimeout(open, 100));
962
959
  }
963
960
  }