@amityco/ts-sdk 7.17.1-1f0ca75.0 → 7.17.1-3d2d30d.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.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/commentRepository/events/utils.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,4BAA4B,UAChC,MAAM,MAAM,iBAAiB,YAC1B,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,uBA0FhD,CAAC;AAEF,eAAO,MAAM,iCAAiC,UACrC,MAAM,KACX,MAAM,kBAAkB,EACxB,2BAA2B,GAAG,8BAA8B,CAC7D,YACS,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,uBAmIhD,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/commentRepository/events/utils.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,4BAA4B,UAChC,MAAM,MAAM,iBAAiB,YAC1B,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,uBA0FhD,CAAC;AAEF,eAAO,MAAM,iCAAiC,UACrC,MAAM,KACX,MAAM,kBAAkB,EACxB,2BAA2B,GAAG,8BAA8B,CAC7D,YACS,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,uBAqIhD,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -18104,8 +18104,10 @@ const createLocalCommentEventSubscriber = (event, callback) => {
18104
18104
  else {
18105
18105
  const postCacheKey = ['post', 'get', comments[0].referenceId];
18106
18106
  const postCache = (_d = pullFromCache(postCacheKey)) === null || _d === void 0 ? void 0 : _d.data;
18107
- const updatedPost = Object.assign(Object.assign({}, postCache), { comments: postCache === null || postCache === void 0 ? void 0 : postCache.comments.filter(commentId => { var _a; return commentId !== ((_a = comments[0]) === null || _a === void 0 ? void 0 : _a.commentId); }) });
18108
- pushToCache(postCacheKey, updatedPost);
18107
+ if (postCache) {
18108
+ const updatedPost = Object.assign(Object.assign({}, postCache), { comments: postCache === null || postCache === void 0 ? void 0 : postCache.comments.filter(commentId => { var _a; return commentId !== ((_a = comments[0]) === null || _a === void 0 ? void 0 : _a.commentId); }) });
18109
+ pushToCache(postCacheKey, updatedPost);
18110
+ }
18109
18111
  }
18110
18112
  const queries = (_e = queryCache(['comment', 'query'])) === null || _e === void 0 ? void 0 : _e.filter(({ key }) => { var _a; return ((_a = key[2]) === null || _a === void 0 ? void 0 : _a.referenceId) === comment.data.referenceId; });
18111
18113
  queries === null || queries === void 0 ? void 0 : queries.map(({ key, data }) => upsertInCache(key, data, { cachedAt: -1 }));
package/dist/index.esm.js CHANGED
@@ -34196,8 +34196,10 @@ const createLocalCommentEventSubscriber = (event, callback) => {
34196
34196
  else {
34197
34197
  const postCacheKey = ['post', 'get', comments[0].referenceId];
34198
34198
  const postCache = (_d = pullFromCache(postCacheKey)) === null || _d === void 0 ? void 0 : _d.data;
34199
- const updatedPost = Object.assign(Object.assign({}, postCache), { comments: postCache === null || postCache === void 0 ? void 0 : postCache.comments.filter(commentId => { var _a; return commentId !== ((_a = comments[0]) === null || _a === void 0 ? void 0 : _a.commentId); }) });
34200
- pushToCache(postCacheKey, updatedPost);
34199
+ if (postCache) {
34200
+ const updatedPost = Object.assign(Object.assign({}, postCache), { comments: postCache === null || postCache === void 0 ? void 0 : postCache.comments.filter(commentId => { var _a; return commentId !== ((_a = comments[0]) === null || _a === void 0 ? void 0 : _a.commentId); }) });
34201
+ pushToCache(postCacheKey, updatedPost);
34202
+ }
34201
34203
  }
34202
34204
  const queries = (_e = queryCache(['comment', 'query'])) === null || _e === void 0 ? void 0 : _e.filter(({ key }) => { var _a; return ((_a = key[2]) === null || _a === void 0 ? void 0 : _a.referenceId) === comment.data.referenceId; });
34203
34205
  queries === null || queries === void 0 ? void 0 : queries.map(({ key, data }) => upsertInCache(key, data, { cachedAt: -1 }));