@amityco/ts-sdk-react-native 7.0.2-3cbb4fc.0 → 7.0.3-d7a9877.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":"AnalyticsEventCapturer.d.ts","sourceRoot":"","sources":["../../../../src/analytic/service/analytic/AnalyticsEventCapturer.ts"],"names":[],"mappings":";AAQA,qBAAa,sBAAsB;IACjC,WAAW,SAAc;IAEzB,UAAU,SAAQ;IAElB,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA;KAAE,CAAM;IAElE,yBAAyB,EAAE;QAAE,CAAC,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAA;KAAE,CAAM;IAGhF,mBAAmB,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAa;IAE5D,+BAA+B,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAM;IAEnE,eAAe,CAAC,EACd,QAAQ,EACR,UAAU,EACV,cAAsB,GACvB,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B;IAoBD,MAAM,CAAC,EACL,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,GACT,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,KAAK,CAAC,wBAAwB,CAAC;QAC5C,YAAY,EAAE,KAAK,CAAC,yBAAyB,CAAC;QAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC;IAmCD,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC;IASrD,SAA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AAC,wBAAwB,CAAC;QAC5C,YAAY,EAAE,KAAK,CAAC,yBAAyB,CAAC;QAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC;IAmCD,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC;IASrD,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,CAAC,yBAAyB;IAuEnF,eAAe;IAQf,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa;IAI5C,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa;IAI7C,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW;IAgBjE,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW;CAenE"}
package/dist/index.cjs.js CHANGED
@@ -123,8 +123,8 @@ const PostContentType = Object.freeze({
123
123
 
124
124
  function getVersion() {
125
125
  try {
126
- // the string ''v7.0.1-cjs'' should be replaced by actual value by @rollup/plugin-replace
127
- return 'v7.0.1-cjs';
126
+ // the string ''v7.0.2-cjs'' should be replaced by actual value by @rollup/plugin-replace
127
+ return 'v7.0.2-cjs';
128
128
  }
129
129
  catch (error) {
130
130
  return '__dev__';
@@ -5026,12 +5026,14 @@ class AnalyticsEventCapturer {
5026
5026
  }
5027
5027
  isAbleToEnqueue({ uniqueId, expireTime, isHighPriority = false, }) {
5028
5028
  const now = new Date();
5029
- const getRecentViewedDate = () => {
5030
- if (isHighPriority)
5031
- return this._recentHighPriorityViewed[uniqueId];
5032
- return this._recentViewed[uniqueId];
5033
- };
5034
- const recentViewedDate = getRecentViewedDate() || new Date(DAY * -1);
5029
+ // Get the recent view date (if any)
5030
+ const recentViewedDate = isHighPriority
5031
+ ? this._recentHighPriorityViewed[uniqueId]
5032
+ : this._recentViewed[uniqueId];
5033
+ // If this is the first view, always allow it
5034
+ if (!recentViewedDate) {
5035
+ return true;
5036
+ }
5035
5037
  const timeDiff = now.getTime() - recentViewedDate.getTime();
5036
5038
  if (timeDiff < expireTime) {
5037
5039
  // just recently view this post, ignore the event.
package/dist/index.esm.js CHANGED
@@ -89,8 +89,8 @@ const PostContentType = Object.freeze({
89
89
 
90
90
  function getVersion() {
91
91
  try {
92
- // the string ''v7.0.1-esm'' should be replaced by actual value by @rollup/plugin-replace
93
- return 'v7.0.1-esm';
92
+ // the string ''v7.0.2-esm'' should be replaced by actual value by @rollup/plugin-replace
93
+ return 'v7.0.2-esm';
94
94
  }
95
95
  catch (error) {
96
96
  return '__dev__';
@@ -21099,12 +21099,14 @@ class AnalyticsEventCapturer {
21099
21099
  }
21100
21100
  isAbleToEnqueue({ uniqueId, expireTime, isHighPriority = false, }) {
21101
21101
  const now = new Date();
21102
- const getRecentViewedDate = () => {
21103
- if (isHighPriority)
21104
- return this._recentHighPriorityViewed[uniqueId];
21105
- return this._recentViewed[uniqueId];
21106
- };
21107
- const recentViewedDate = getRecentViewedDate() || new Date(DAY * -1);
21102
+ // Get the recent view date (if any)
21103
+ const recentViewedDate = isHighPriority
21104
+ ? this._recentHighPriorityViewed[uniqueId]
21105
+ : this._recentViewed[uniqueId];
21106
+ // If this is the first view, always allow it
21107
+ if (!recentViewedDate) {
21108
+ return true;
21109
+ }
21108
21110
  const timeDiff = now.getTime() - recentViewedDate.getTime();
21109
21111
  if (timeDiff < expireTime) {
21110
21112
  // just recently view this post, ignore the event.