@amityco/ts-sdk-react-native 7.5.2 → 7.5.3

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.5.2",
3
+ "version": "7.5.3",
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",
@@ -1,25 +1,3 @@
1
- import { ASCError } from '~/core/errors';
2
- import { getActiveClient } from './activeClient';
3
-
4
1
  export const enableUnreadCount = () => {
5
- const client = getActiveClient();
6
-
7
- client.log('client/api/isUnreadCountEnabled', client.isUnreadCountEnabled);
8
-
9
- if (!client) {
10
- throw new ASCError(
11
- 'There is no active client',
12
- Amity.ClientError.UNKNOWN_ERROR,
13
- Amity.ErrorLevel.FATAL,
14
- );
15
- }
16
-
17
- if (client.isUnreadCountEnabled) return false;
18
-
19
- client.isUnreadCountEnabled = true;
20
- client.useLegacyUnreadCount = false;
21
-
22
- client.emitter.emit('unreadCountEnabled', true);
23
-
24
2
  return true;
25
3
  };
@@ -26,7 +26,6 @@ import { onTokenTerminated } from '../events/onTokenTerminated';
26
26
  import { setClientToken } from '../utils/setClientToken';
27
27
  import { removeChannelMarkerCache } from '../utils/removeChannelMarkerCache';
28
28
  import { initializeMessagePreviewSetting } from '../utils/messagePreviewEngine';
29
- import { startMarkerSync } from '../utils/markerSyncEngine';
30
29
  import { ASCError } from '~/core/errors';
31
30
  import SessionWatcher from '../utils/SessionWatcher';
32
31
 
@@ -207,9 +206,6 @@ export const login = async (
207
206
  if (client.useLegacyUnreadCount) {
208
207
  subscriptions.push(readReceiptSyncEngineOnLoginHandler());
209
208
  } else subscriptions.push(legacyReadReceiptSyncEngineOnLoginHandler());
210
-
211
- const markerSyncUnsubscriber = await startMarkerSync();
212
- subscriptions.push(markerSyncUnsubscriber);
213
209
  }
214
210
 
215
211
  return true;
@@ -14,7 +14,6 @@ import { onSubChannelDeleted } from '~/subChannelRepository/events/onSubChannelD
14
14
  import { isUnreadCountSupport } from '~/subChannelRepository/utils';
15
15
 
16
16
  import { markerSync } from '../api/markerSync';
17
- import { enableUnreadCount } from '../api/enableUnreadCount';
18
17
 
19
18
  import { onOnline } from './onOnline';
20
19
  import { onUserFeedMarkerUpdated } from '~/marker/events/onUserFeedMarkerUpdated';
@@ -27,7 +26,7 @@ let isSyncRunning = false;
27
26
  let disposers: (() => void)[] = [];
28
27
  let isWaitingForResponse = false;
29
28
 
30
- let isConsistentMode = true;
29
+ const isConsistentMode = true;
31
30
  let deviceLastSyncAt: Date | null = null;
32
31
 
33
32
  const getDeviceLastSyncAt = () => {
@@ -178,17 +177,7 @@ const unRegisterEventListeners = () => {
178
177
  disposers = [];
179
178
  };
180
179
 
181
- export const startMarkerSync = async () => {
182
- await fetchDeviceLastSyncAt();
183
- pushMarkerSyncEvent(Amity.MarkerSyncEvent.START_SYNCING);
184
-
185
- isConsistentMode = true;
186
- isSyncRunning = true;
187
-
188
- registerEventListeners();
189
-
190
- return unRegisterEventListeners;
191
- };
180
+ export const startMarkerSync = async () => Promise.resolve();
192
181
 
193
182
  /**
194
183
  ```js
@@ -201,17 +190,7 @@ export const startMarkerSync = async () => {
201
190
  *
202
191
  * @category Marker API
203
192
  */
204
- export const startUnreadSync = async () => {
205
- await fetchDeviceLastSyncAt();
206
- pushMarkerSyncEvent(Amity.MarkerSyncEvent.START_SYNCING);
207
-
208
- enableUnreadCount();
209
-
210
- isConsistentMode = false;
211
- isSyncRunning = true;
212
-
213
- registerEventListeners();
214
- };
193
+ export const startUnreadSync = async () => Promise.resolve();
215
194
 
216
195
  /**
217
196
  ```js
@@ -59,7 +59,7 @@ export const addReaction = async (
59
59
  referenceId,
60
60
  ]);
61
61
 
62
- if (!model) return true;
62
+ if (!model || model.data.myReactions?.includes(reactionName)) return true;
63
63
 
64
64
  const updatedModel = {
65
65
  ...model.data,