@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/.env +26 -26
- package/dist/@types/domains/client.d.ts +3 -0
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/client/api/login.d.ts.map +1 -1
- package/dist/client/utils/endpoints.d.ts +1 -1
- package/dist/client/utils/markerSyncEngine.d.ts +1 -1
- package/dist/client/utils/markerSyncEngine.d.ts.map +1 -1
- package/dist/index.cjs.js +13 -6
- package/dist/index.esm.js +13 -6
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
- package/src/@types/domains/client.ts +4 -0
- package/src/client/api/login.ts +4 -2
- package/src/client/utils/endpoints.ts +1 -1
- package/src/client/utils/markerSyncEngine.ts +5 -0
package/package.json
CHANGED
package/src/client/api/login.ts
CHANGED
|
@@ -204,8 +204,10 @@ export const login = async (
|
|
|
204
204
|
objectResolverEngineOnLoginHandler(),
|
|
205
205
|
);
|
|
206
206
|
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
if (client.isUnreadCountEnabled) {
|
|
208
|
+
const markerSyncUnsubscriber = await startMarkerSync();
|
|
209
|
+
markerSyncUnsubscriber && subscriptions.push(markerSyncUnsubscriber);
|
|
210
|
+
}
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
return true;
|
|
@@ -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
|
|