@zero-library/chat-agent 2.1.1 → 2.1.2

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.esm.js CHANGED
@@ -649,7 +649,7 @@ function createChatStore() {
649
649
  const resolveConversationId = async (receiverId, strategy = 2) => {
650
650
  if (strategy === 1) {
651
651
  const { data } = await conversationRecentQuery({
652
- receiverId: String(receiverId),
652
+ receiverId,
653
653
  receiverType: 3,
654
654
  businessId: config.params.businessId,
655
655
  businessType: config.params.businessType
@@ -657,7 +657,7 @@ function createChatStore() {
657
657
  return data;
658
658
  } else {
659
659
  const { data } = await conversationCreate({
660
- receiverId: String(receiverId),
660
+ receiverId,
661
661
  receiverType: 3,
662
662
  businessId: config.params.businessId,
663
663
  businessType: config.params.businessType,
@@ -731,6 +731,7 @@ function createChatStore() {
731
731
  } finally {
732
732
  }
733
733
  config.hooks?.onAfterInitMessages?.(conversation.messages[conversationId].message);
734
+ config.hooks?.onAfterInit?.();
734
735
  }
735
736
  };
736
737
  const pickReceiver = () => {
@@ -1820,7 +1821,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
1820
1821
  return;
1821
1822
  }
1822
1823
  if (config?.receiverId && config?.receiverType === 3) {
1823
- chatStore.switchAgentConversation(config.receiverId, config.conversationStrategy);
1824
+ chatStore.switchAgentConversation(String(config.receiverId), config.conversationStrategy);
1824
1825
  }
1825
1826
  }, [config]);
1826
1827
  useEffect(() => {