@onyx-p/imlib-web 2.1.7 → 2.1.9

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.
Files changed (3) hide show
  1. package/index.esm.js +11 -17
  2. package/index.umd.js +11 -17
  3. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -13681,9 +13681,6 @@ class WebSocketServer {
13681
13681
  return true;
13682
13682
  }
13683
13683
  setStatus(status) {
13684
- if (status === this.status) {
13685
- return;
13686
- }
13687
13684
  logger.info(`socketServer is changing status from ${getStateDesc(this.status)} to ${getStateDesc(status)}`);
13688
13685
  this.status = status;
13689
13686
  this.watcher?.status(status);
@@ -20982,7 +20979,6 @@ const GroupCloseBurnAfterReadingMessage = registerMessageType$1(NotiMessageTypes
20982
20979
  const RecallCommandMessage = registerMessageType$1(MessageTypes.RECALL, true, false, false);
20983
20980
 
20984
20981
  class MessageCache {
20985
- static instance;
20986
20982
  loadedEndMap = new Map();
20987
20983
  db = null;
20988
20984
  currentAppKey = '';
@@ -21702,19 +21698,7 @@ class LibLoader {
21702
21698
  };
21703
21699
  }
21704
21700
  const code = await webSocketServer.connect();
21705
- if (code === ErrorCode.SUCCESS) {
21706
- this.isInternalConnected = true;
21707
- ConversationManager$1.get().destroyed();
21708
- ConversationManager$1.create(this.options.appkey, accountStore.uid.toString(), this.watcher.conversationState);
21709
- MessageReceiptManager$1.create(this.options.appkey, accountStore.uid.toString());
21710
- MessageCache$1.create(this.options.appkey, accountStore.uid.toString());
21711
- this.messageLoader?.stop();
21712
- this.messageLoader = new MessageLoader(this.watcher, this.options);
21713
- synchronizeServerTime();
21714
- SentMessageStore.reset();
21715
- RecallMessageStore.reset();
21716
- DialogSecretKey$1.reset();
21717
- }
21701
+ this.isInternalConnected = true;
21718
21702
  return {
21719
21703
  code
21720
21704
  };
@@ -21733,6 +21717,15 @@ class LibLoader {
21733
21717
  return Promise.resolve();
21734
21718
  }
21735
21719
  setUserLogged() {
21720
+ ConversationManager$1.get().destroyed();
21721
+ ConversationManager$1.create(this.options.appkey, accountStore.uid.toString(), this.watcher.conversationState);
21722
+ MessageReceiptManager$1.create(this.options.appkey, accountStore.uid.toString());
21723
+ MessageCache$1.create(this.options.appkey, accountStore.uid.toString());
21724
+ this.messageLoader?.stop();
21725
+ this.messageLoader = new MessageLoader(this.watcher, this.options);
21726
+ SentMessageStore.reset();
21727
+ RecallMessageStore.reset();
21728
+ DialogSecretKey$1.reset();
21736
21729
  if (this.getConnectionStatus() === ConnectionStatus.CONNECTED) {
21737
21730
  this.handleUserConnected();
21738
21731
  }
@@ -21784,6 +21777,7 @@ class LibLoader {
21784
21777
  this.watcher.onConnected?.();
21785
21778
  if (accountStore.isActive) {
21786
21779
  this.handleUserConnected();
21780
+ synchronizeServerTime();
21787
21781
  }
21788
21782
  }
21789
21783
  handleDisconnect() {
package/index.umd.js CHANGED
@@ -13687,9 +13687,6 @@
13687
13687
  return true;
13688
13688
  }
13689
13689
  setStatus(status) {
13690
- if (status === this.status) {
13691
- return;
13692
- }
13693
13690
  logger.info(`socketServer is changing status from ${getStateDesc(this.status)} to ${getStateDesc(status)}`);
13694
13691
  this.status = status;
13695
13692
  this.watcher?.status(status);
@@ -20988,7 +20985,6 @@
20988
20985
  const RecallCommandMessage = registerMessageType$1(MessageTypes.RECALL, true, false, false);
20989
20986
 
20990
20987
  class MessageCache {
20991
- static instance;
20992
20988
  loadedEndMap = new Map();
20993
20989
  db = null;
20994
20990
  currentAppKey = '';
@@ -21708,19 +21704,7 @@
21708
21704
  };
21709
21705
  }
21710
21706
  const code = await webSocketServer.connect();
21711
- if (code === exports.ErrorCode.SUCCESS) {
21712
- this.isInternalConnected = true;
21713
- ConversationManager$1.get().destroyed();
21714
- ConversationManager$1.create(this.options.appkey, accountStore.uid.toString(), this.watcher.conversationState);
21715
- MessageReceiptManager$1.create(this.options.appkey, accountStore.uid.toString());
21716
- MessageCache$1.create(this.options.appkey, accountStore.uid.toString());
21717
- this.messageLoader?.stop();
21718
- this.messageLoader = new MessageLoader(this.watcher, this.options);
21719
- synchronizeServerTime();
21720
- SentMessageStore.reset();
21721
- RecallMessageStore.reset();
21722
- DialogSecretKey$1.reset();
21723
- }
21707
+ this.isInternalConnected = true;
21724
21708
  return {
21725
21709
  code
21726
21710
  };
@@ -21739,6 +21723,15 @@
21739
21723
  return Promise.resolve();
21740
21724
  }
21741
21725
  setUserLogged() {
21726
+ ConversationManager$1.get().destroyed();
21727
+ ConversationManager$1.create(this.options.appkey, accountStore.uid.toString(), this.watcher.conversationState);
21728
+ MessageReceiptManager$1.create(this.options.appkey, accountStore.uid.toString());
21729
+ MessageCache$1.create(this.options.appkey, accountStore.uid.toString());
21730
+ this.messageLoader?.stop();
21731
+ this.messageLoader = new MessageLoader(this.watcher, this.options);
21732
+ SentMessageStore.reset();
21733
+ RecallMessageStore.reset();
21734
+ DialogSecretKey$1.reset();
21742
21735
  if (this.getConnectionStatus() === exports.ConnectionStatus.CONNECTED) {
21743
21736
  this.handleUserConnected();
21744
21737
  }
@@ -21790,6 +21783,7 @@
21790
21783
  this.watcher.onConnected?.();
21791
21784
  if (accountStore.isActive) {
21792
21785
  this.handleUserConnected();
21786
+ synchronizeServerTime();
21793
21787
  }
21794
21788
  }
21795
21789
  handleDisconnect() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onyx-p/imlib-web",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "types": "types/index.d.ts",