@amityco/ts-sdk-react-native 7.0.2-3cbb4fc.0 → 7.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk-react-native",
3
- "version": "7.0.2-3cbb4fc.0",
3
+ "version": "7.0.2",
4
4
  "license": "CC-BY-ND-4.0",
5
5
  "author": "amity.co <developers@amity.co> (https://amity.co)",
6
6
  "description": "Amity Social Cloud Typescript SDK",
@@ -31,12 +31,15 @@ export class AnalyticsEventCapturer {
31
31
  }) {
32
32
  const now = new Date();
33
33
 
34
- const getRecentViewedDate = () => {
35
- if (isHighPriority) return this._recentHighPriorityViewed[uniqueId];
36
- return this._recentViewed[uniqueId];
37
- };
38
-
39
- const recentViewedDate = getRecentViewedDate() || new Date(DAY * -1);
34
+ // Get the recent view date (if any)
35
+ const recentViewedDate = isHighPriority
36
+ ? this._recentHighPriorityViewed[uniqueId]
37
+ : this._recentViewed[uniqueId];
38
+
39
+ // If this is the first view, always allow it
40
+ if (!recentViewedDate) {
41
+ return true;
42
+ }
40
43
 
41
44
  const timeDiff = now.getTime() - recentViewedDate.getTime();
42
45