@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.
@@ -887,7 +887,7 @@ function _listen(query, params, opts = {}) {
887
887
  }
888
888
  function open() {
889
889
  getEventSource().then((eventSource) => {
890
- eventSource && (es = eventSource, unsubscribed && unsubscribe());
890
+ eventSource && (es = eventSource);
891
891
  }).catch((reason) => {
892
892
  observer.error(reason), stop();
893
893
  });
@@ -934,13 +934,10 @@ class LiveClient {
934
934
  open();
935
935
  function onError(evt) {
936
936
  if (!stopped) {
937
- if ("data" in evt)
938
- try {
939
- const event = parseEvent(evt);
940
- observer.error(new Error(event.message, { cause: event }));
941
- } catch (err) {
942
- observer.error(err);
943
- }
937
+ if ("data" in evt) {
938
+ const event = parseEvent(evt);
939
+ observer.error(new Error(event.message, { cause: event }));
940
+ }
944
941
  es.readyState === es.CLOSED && (unsubscribe(), clearTimeout(reconnectTimer), reconnectTimer = setTimeout(open, 100));
945
942
  }
946
943
  }