@amityco/ts-sdk-react-native 7.5.3-2c40726.0 → 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/.env +26 -26
- package/dist/client/api/enableUnreadCount.d.ts.map +1 -1
- package/dist/client/api/login.d.ts.map +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 +323 -434
- package/dist/index.esm.js +273 -384
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
- package/src/client/api/enableUnreadCount.ts +0 -22
- package/src/client/api/login.ts +0 -4
- package/src/client/utils/markerSyncEngine.ts +3 -24
- package/src/reactionRepository/api/addReaction.ts +1 -1
package/package.json
CHANGED
|
@@ -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
|
};
|
package/src/client/api/login.ts
CHANGED
|
@@ -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
|
-
|
|
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
|