@zero-library/chat-agent 2.1.1 → 2.1.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/dist/index.cjs.js CHANGED
@@ -657,7 +657,7 @@ function createChatStore() {
657
657
  const resolveConversationId = async (receiverId, strategy = 2) => {
658
658
  if (strategy === 1) {
659
659
  const { data } = await conversationRecentQuery({
660
- receiverId: String(receiverId),
660
+ receiverId,
661
661
  receiverType: 3,
662
662
  businessId: config.params.businessId,
663
663
  businessType: config.params.businessType
@@ -665,7 +665,7 @@ function createChatStore() {
665
665
  return data;
666
666
  } else {
667
667
  const { data } = await conversationCreate({
668
- receiverId: String(receiverId),
668
+ receiverId,
669
669
  receiverType: 3,
670
670
  businessId: config.params.businessId,
671
671
  businessType: config.params.businessType,
@@ -739,6 +739,7 @@ function createChatStore() {
739
739
  } finally {
740
740
  }
741
741
  config.hooks?.onAfterInitMessages?.(conversation.messages[conversationId].message);
742
+ config.hooks?.onAfterInit?.();
742
743
  }
743
744
  };
744
745
  const pickReceiver = () => {
@@ -798,6 +799,7 @@ function createChatStore() {
798
799
  }
799
800
  };
800
801
  const cancelReceive = async () => {
802
+ console.log("\u53D6\u6D88\u63A5\u6536");
801
803
  await conversationStop(conversation.active.id);
802
804
  };
803
805
  const updateConversationTitle = (conversationId, title) => {
@@ -1828,7 +1830,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
1828
1830
  return;
1829
1831
  }
1830
1832
  if (config?.receiverId && config?.receiverType === 3) {
1831
- chatStore.switchAgentConversation(config.receiverId, config.conversationStrategy);
1833
+ chatStore.switchAgentConversation(String(config.receiverId), config.conversationStrategy);
1832
1834
  }
1833
1835
  }, [config]);
1834
1836
  react.useEffect(() => {
@@ -1873,7 +1875,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
1873
1875
  }
1874
1876
  }, [hasPreView]);
1875
1877
  common.useWebSocket({
1876
- url: common.getWebSocketUrl(`/lolr/conversation/ws/subscribe?NS-TOKEN=${common.getToken()}`, common.isLocalhost() ? "192.168.6.23:9090" : ""),
1878
+ url: common.getWebSocketUrl(`/api/lolr/conversation/ws/subscribe?NS-TOKEN=${common.getToken()}`, common.isLocalhost() ? "192.168.6.23" : ""),
1877
1879
  onMessage: chatStore.acceptMessage,
1878
1880
  clientHeartbeat: false,
1879
1881
  reconnectInterval: 1e4