bruce-models 1.0.1 → 1.0.3

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.
@@ -4646,7 +4646,18 @@ var ProjectViewBookmark;
4646
4646
  const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
4647
4647
  try {
4648
4648
  const data = yield api.GET(`ui.view/${viewId}/slides`, Api.PrepReqParams(reqParams));
4649
- res(data.Items);
4649
+ const items = data.Items ? data.Items : [];
4650
+ // Cache individual items.
4651
+ // Maybe better to load list cache when getting 1 slide and seeing if it's in there.
4652
+ // WARNING: Right now the data matches, in the future the list may contain a shortened result.
4653
+ for (let i = 0; i < items.length; i++) {
4654
+ const item = items[i];
4655
+ const prom = new Promise((res) => {
4656
+ res(item);
4657
+ });
4658
+ api.Cache.Set(GetCacheKey(viewId, item.ID), prom, Api.DEFAULT_CACHE_DURATION);
4659
+ }
4660
+ res(items);
4650
4661
  }
4651
4662
  catch (e) {
4652
4663
  rej(e);