@zero-library/chat-agent 2.1.12 → 2.1.13

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
@@ -553,8 +553,8 @@ function createChatStore() {
553
553
  character.loading = true;
554
554
  const { data } = await config.services.request.agentCharacterQuery(agentId);
555
555
  if (receiver.active.id !== agentId) return;
556
- character.list = data;
557
- const active = data.find((item) => item.selected);
556
+ character.list = data || [];
557
+ const active = character.list.find((item) => item.selected);
558
558
  if (active) {
559
559
  character.active = active;
560
560
  }
@@ -1381,7 +1381,7 @@ var AgentCharacter_default = () => {
1381
1381
  chatStore.getCharacters(receiverState.active.id);
1382
1382
  }
1383
1383
  }, [receiverState.active.id]);
1384
- return characterState.active.id && /* @__PURE__ */ jsxs(Fragment, { children: [
1384
+ return characterState.active?.id && /* @__PURE__ */ jsxs(Fragment, { children: [
1385
1385
  /* @__PURE__ */ jsx("div", { title: "\u6027\u683C", children: /* @__PURE__ */ jsx(Avatar, { onClick: chatStore.openCharacterList, className: "cursor-pointer", src: characterState.active.logo }) }),
1386
1386
  characterState.open && /* @__PURE__ */ jsx(CharacterList_default, {})
1387
1387
  ] });
@@ -1746,9 +1746,9 @@ var SenderPromptsItems_default = () => {
1746
1746
  const chatStore = useChatStore();
1747
1747
  const receiverState = useSnapshot(chatStore.receiver);
1748
1748
  const component = useMemo(
1749
- () => receiverState.active.config?.labels?.length > 0 && /* @__PURE__ */ jsxs(Flex, { gap: 4, className: "overflow-hidden", children: [
1749
+ () => receiverState.active.config?.labels?.length > 0 && /* @__PURE__ */ jsxs(Flex, { gap: 4, wrap: true, children: [
1750
1750
  /* @__PURE__ */ jsx(Button, { disabled: true, color: "default", variant: "text", children: "\u968F\u4FBF\u804A\u804A" }),
1751
- receiverState.active.config.labels.map((question) => /* @__PURE__ */ jsx(
1751
+ receiverState.active.config.labels.slice(0, 6).map((question) => /* @__PURE__ */ jsx(
1752
1752
  Popover,
1753
1753
  {
1754
1754
  content: /* @__PURE__ */ jsx(