@onyx-p/imlib-web 2.0.1 → 2.0.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/index.esm.js CHANGED
@@ -13402,13 +13402,13 @@ class WebSocketServer {
13402
13402
  this.watcher = watcher;
13403
13403
  }
13404
13404
  async connect() {
13405
+ this.autoReconnect = true;
13405
13406
  return new Promise(resolve => {
13406
13407
  this.connectResolve = resolve;
13407
13408
  this.open().then(authCode => {
13408
13409
  resolve(authCode);
13409
13410
  if (authCode === ErrorCode.SUCCESS) {
13410
13411
  this.isConnected = true;
13411
- this.autoReconnect = true;
13412
13412
  this.onConnect();
13413
13413
  } else {
13414
13414
  this.onDisconnect(authCode === ErrorCode.TIMEOUT ? ConnectionStatus.NETWORK_UNAVAILABLE : ConnectionStatus.WEBSOCKET_UNAVAILABLE);
@@ -28391,13 +28391,13 @@ class MessageCache {
28391
28391
  }
28392
28392
  }
28393
28393
  addMessages(messages, toConversation, isEnd = undefined) {
28394
- if (!messages || messages.length === 0) {
28395
- return;
28396
- }
28397
28394
  const dialogId = getFullDialogId(toConversation);
28398
- if (isEnd !== undefined) {
28395
+ if (isDef(isEnd)) {
28399
28396
  this.loadedEndMap.set(dialogId, isEnd);
28400
28397
  }
28398
+ if (!messages || messages.length === 0) {
28399
+ return;
28400
+ }
28401
28401
  if (!this.messageCache.has(dialogId)) {
28402
28402
  this.messageCache.set(dialogId, []);
28403
28403
  }
package/index.umd.js CHANGED
@@ -13408,13 +13408,13 @@
13408
13408
  this.watcher = watcher;
13409
13409
  }
13410
13410
  async connect() {
13411
+ this.autoReconnect = true;
13411
13412
  return new Promise(resolve => {
13412
13413
  this.connectResolve = resolve;
13413
13414
  this.open().then(authCode => {
13414
13415
  resolve(authCode);
13415
13416
  if (authCode === exports.ErrorCode.SUCCESS) {
13416
13417
  this.isConnected = true;
13417
- this.autoReconnect = true;
13418
13418
  this.onConnect();
13419
13419
  } else {
13420
13420
  this.onDisconnect(authCode === exports.ErrorCode.TIMEOUT ? exports.ConnectionStatus.NETWORK_UNAVAILABLE : exports.ConnectionStatus.WEBSOCKET_UNAVAILABLE);
@@ -28397,13 +28397,13 @@
28397
28397
  }
28398
28398
  }
28399
28399
  addMessages(messages, toConversation, isEnd = undefined) {
28400
- if (!messages || messages.length === 0) {
28401
- return;
28402
- }
28403
28400
  const dialogId = getFullDialogId(toConversation);
28404
- if (isEnd !== undefined) {
28401
+ if (isDef(isEnd)) {
28405
28402
  this.loadedEndMap.set(dialogId, isEnd);
28406
28403
  }
28404
+ if (!messages || messages.length === 0) {
28405
+ return;
28406
+ }
28407
28407
  if (!this.messageCache.has(dialogId)) {
28408
28408
  this.messageCache.set(dialogId, []);
28409
28409
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onyx-p/imlib-web",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "types": "types/index.d.ts",