@amityco/ts-sdk 6.35.3-fa3d4ac.0 → 6.35.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",
3
- "version": "6.35.3-fa3d4ac.0",
3
+ "version": "6.35.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",
@@ -106,6 +106,10 @@ declare global {
106
106
  enabled: boolean;
107
107
  isIncludeDeleted: boolean;
108
108
  };
109
+ // default value is true
110
+ marker: {
111
+ enabled: boolean;
112
+ };
109
113
  };
110
114
 
111
115
  type FeedSettings = {
@@ -204,8 +204,10 @@ export const login = async (
204
204
  objectResolverEngineOnLoginHandler(),
205
205
  );
206
206
 
207
- const markerSyncUnsubscriber = await startMarkerSync();
208
- subscriptions.push(markerSyncUnsubscriber);
207
+ if (client.isUnreadCountEnabled) {
208
+ const markerSyncUnsubscriber = await startMarkerSync();
209
+ markerSyncUnsubscriber && subscriptions.push(markerSyncUnsubscriber);
210
+ }
209
211
  }
210
212
 
211
213
  return true;
@@ -5,7 +5,7 @@ export const API_REGIONS = {
5
5
  } as const;
6
6
 
7
7
  const URLS = {
8
- http: 'https://api.{region}.amity.co',
8
+ http: 'https://apix.{region}.amity.co',
9
9
  mqtt: 'wss://sse.{region}.amity.co:443/mqtt',
10
10
  } as const;
11
11
 
@@ -19,6 +19,7 @@ import { enableUnreadCount } from '../api/enableUnreadCount';
19
19
  import { onOnline } from './onOnline';
20
20
  import { onUserFeedMarkerUpdated } from '~/marker/events/onUserFeedMarkerUpdated';
21
21
  import { getActiveClient } from '~/client/api/activeClient';
22
+ import { getChatSettings } from '../api/getChatSettings';
22
23
 
23
24
  const SYNC_TRIGGER_INTERVAL_TIME = 2000;
24
25
  const ON_SUB_CHANNEL_DELETE_SYNC_TRIGGER_DELAY = 2000;
@@ -179,6 +180,10 @@ const unRegisterEventListeners = () => {
179
180
  };
180
181
 
181
182
  export const startMarkerSync = async () => {
183
+ // check the chat setting, if marker enabled is false, should not start marker syncing
184
+ const setting = await getChatSettings();
185
+ if (!setting.marker?.enabled) return;
186
+
182
187
  await fetchDeviceLastSyncAt();
183
188
  pushMarkerSyncEvent(Amity.MarkerSyncEvent.START_SYNCING);
184
189