@amityco/ts-sdk 6.7.3-d52e869.0 → 6.7.3-e2bf070.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
@@ -13077,7 +13077,7 @@ const getMessages = (params, callback, config) => {
13077
13077
  const limit = queryLimit !== null && queryLimit !== void 0 ? queryLimit : COLLECTION_DEFAULT_PAGINATION_LIMIT;
13078
13078
  const { policy = COLLECTION_DEFAULT_CACHING_POLICY } = config !== null && config !== void 0 ? config : {};
13079
13079
  const disposers = [];
13080
- const cacheKey = ['message', 'collection', Object.assign(Object.assign({}, params), { uuid: uuid() })];
13080
+ const cacheKey = ['message', 'collection', params, uuid()];
13081
13081
  const responder = (data) => {
13082
13082
  var _a, _b;
13083
13083
  let messages = (_a = data.data
@@ -13109,14 +13109,11 @@ const getMessages = (params, callback, config) => {
13109
13109
  error: data.error,
13110
13110
  });
13111
13111
  };
13112
- const realtimeRouter = (_) => (message) => {
13112
+ const realtimeRouter = (action) => (message) => {
13113
13113
  var _a;
13114
13114
  const collection = (_a = pullFromCache(cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
13115
13115
  if (params.subChannelId !== (message === null || message === void 0 ? void 0 : message.subChannelId) || !collection)
13116
13116
  return;
13117
- if (!collection.data.includes(message.messageId)) {
13118
- collection.data = [...new Set([message.messageId, ...collection.data])];
13119
- }
13120
13117
  pushToCache(cacheKey, collection);
13121
13118
  responder(collection);
13122
13119
  };
package/dist/index.esm.js CHANGED
@@ -29168,7 +29168,7 @@ const getMessages = (params, callback, config) => {
29168
29168
  const limit = queryLimit !== null && queryLimit !== void 0 ? queryLimit : COLLECTION_DEFAULT_PAGINATION_LIMIT;
29169
29169
  const { policy = COLLECTION_DEFAULT_CACHING_POLICY } = config !== null && config !== void 0 ? config : {};
29170
29170
  const disposers = [];
29171
- const cacheKey = ['message', 'collection', Object.assign(Object.assign({}, params), { uuid: uuid() })];
29171
+ const cacheKey = ['message', 'collection', params, uuid()];
29172
29172
  const responder = (data) => {
29173
29173
  var _a, _b;
29174
29174
  let messages = (_a = data.data
@@ -29200,14 +29200,11 @@ const getMessages = (params, callback, config) => {
29200
29200
  error: data.error,
29201
29201
  });
29202
29202
  };
29203
- const realtimeRouter = (_) => (message) => {
29203
+ const realtimeRouter = (action) => (message) => {
29204
29204
  var _a;
29205
29205
  const collection = (_a = pullFromCache(cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
29206
29206
  if (params.subChannelId !== (message === null || message === void 0 ? void 0 : message.subChannelId) || !collection)
29207
29207
  return;
29208
- if (!collection.data.includes(message.messageId)) {
29209
- collection.data = [...new Set([message.messageId, ...collection.data])];
29210
- }
29211
29208
  pushToCache(cacheKey, collection);
29212
29209
  responder(collection);
29213
29210
  };