tsviewer 1.0.25 → 1.0.26

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.
@@ -12860,7 +12860,16 @@ const getLayerIndex = (e, t, n) => {
12860
12860
  propOr([{}], "properties"),
12861
12861
  find(propEq("category", "Blackfynn")),
12862
12862
  propOr([{}], "properties")
12863
- )(e.activeViewer)
12863
+ )(e.activeViewer),
12864
+ /**
12865
+ * Getter to check if file is processed
12866
+ * @param {Object} fileRecord - The file record object to check status for
12867
+ * @returns {Boolean} True if file is processed (READY), false otherwise
12868
+ */
12869
+ isTSFileProcessed: (e) => (t) => {
12870
+ var r;
12871
+ return ((r = t == null ? void 0 : t.content) == null ? void 0 : r.state) === "READY";
12872
+ }
12864
12873
  },
12865
12874
  actions: {
12866
12875
  clearState() {
@@ -12871,7 +12880,9 @@ const getLayerIndex = (e, t, n) => {
12871
12880
  },
12872
12881
  async fetchAndSetActiveViewer(e) {
12873
12882
  const t = e.packageId, n = await useToken(), r = `https://api.pennsieve.net/packages/${t}?api_key=${n}`, i = await useSendXhr(r);
12874
- this.setActiveViewer(i);
12883
+ if (this.isFileProcessed(i))
12884
+ return this.setActiveViewer(i), Promise.resolve(i);
12885
+ throw new Error("Timeseries viewer is not available, since the file is not processed");
12875
12886
  },
12876
12887
  closeViewer() {
12877
12888
  this.clearState();