@amityco/ts-sdk-react-native 7.8.2-423c4c9.0 → 7.8.3-e4f1111.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.
package/dist/index.cjs.js CHANGED
@@ -199,8 +199,8 @@ exports.FeedSourceEnum = void 0;
199
199
 
200
200
  function getVersion() {
201
201
  try {
202
- // the string ''v7.8.1-cjs'' should be replaced by actual value by @rollup/plugin-replace
203
- return 'v7.8.1-cjs';
202
+ // the string ''v7.8.2-cjs'' should be replaced by actual value by @rollup/plugin-replace
203
+ return 'v7.8.2-cjs';
204
204
  }
205
205
  catch (error) {
206
206
  return '__dev__';
@@ -15387,12 +15387,19 @@ const prepareSemanticSearchPostPayload = (_a) => {
15387
15387
  const processDeleteChildPost = (payload) => {
15388
15388
  var _a;
15389
15389
  const post = payload.posts[0];
15390
- if (!post.parentId)
15391
- return;
15392
- const parentPost = (_a = pullFromCache(['post', 'get', post.parentPostId])) === null || _a === void 0 ? void 0 : _a.data;
15393
- if (!parentPost)
15394
- return;
15395
- pushToCache(['post', 'get', parentPost.postId], Object.assign(Object.assign({}, parentPost), { children: parentPost.children.filter(childId => childId !== post.postId) }));
15390
+ if (!post.parentId) {
15391
+ // post is parent post => should mark child post as delete as well
15392
+ post.children.forEach(childrenId => mergeInCache(['post', 'get', childrenId], {
15393
+ isDeleted: true,
15394
+ }));
15395
+ }
15396
+ else {
15397
+ // child post in a parent post
15398
+ const parentPost = (_a = pullFromCache(['post', 'get', post.parentPostId])) === null || _a === void 0 ? void 0 : _a.data;
15399
+ if (!parentPost)
15400
+ return;
15401
+ pushToCache(['post', 'get', parentPost.postId], Object.assign(Object.assign({}, parentPost), { children: parentPost.children.filter(childId => childId !== post.postId) }));
15402
+ }
15396
15403
  };
15397
15404
  const processCreateChildPost = (payload) => {
15398
15405
  var _a;
package/dist/index.esm.js CHANGED
@@ -164,8 +164,8 @@ var FeedSourceEnum;
164
164
 
165
165
  function getVersion() {
166
166
  try {
167
- // the string ''v7.8.1-esm'' should be replaced by actual value by @rollup/plugin-replace
168
- return 'v7.8.1-esm';
167
+ // the string ''v7.8.2-esm'' should be replaced by actual value by @rollup/plugin-replace
168
+ return 'v7.8.2-esm';
169
169
  }
170
170
  catch (error) {
171
171
  return '__dev__';
@@ -31459,12 +31459,19 @@ const prepareSemanticSearchPostPayload = (_a) => {
31459
31459
  const processDeleteChildPost = (payload) => {
31460
31460
  var _a;
31461
31461
  const post = payload.posts[0];
31462
- if (!post.parentId)
31463
- return;
31464
- const parentPost = (_a = pullFromCache(['post', 'get', post.parentPostId])) === null || _a === void 0 ? void 0 : _a.data;
31465
- if (!parentPost)
31466
- return;
31467
- pushToCache(['post', 'get', parentPost.postId], Object.assign(Object.assign({}, parentPost), { children: parentPost.children.filter(childId => childId !== post.postId) }));
31462
+ if (!post.parentId) {
31463
+ // post is parent post => should mark child post as delete as well
31464
+ post.children.forEach(childrenId => mergeInCache(['post', 'get', childrenId], {
31465
+ isDeleted: true,
31466
+ }));
31467
+ }
31468
+ else {
31469
+ // child post in a parent post
31470
+ const parentPost = (_a = pullFromCache(['post', 'get', post.parentPostId])) === null || _a === void 0 ? void 0 : _a.data;
31471
+ if (!parentPost)
31472
+ return;
31473
+ pushToCache(['post', 'get', parentPost.postId], Object.assign(Object.assign({}, parentPost), { children: parentPost.children.filter(childId => childId !== post.postId) }));
31474
+ }
31468
31475
  };
31469
31476
  const processCreateChildPost = (payload) => {
31470
31477
  var _a;