@myun/gimi-chat 0.2.4 → 0.2.6

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.
@@ -14,6 +14,10 @@ var AskCard = function AskCard(_ref) {
14
14
  moduleInfo = _ref.moduleInfo,
15
15
  handleClickAskList = _ref.handleClickAskList,
16
16
  onAskCardCallback = _ref.onAskCardCallback;
17
+ var _React$useState = React.useState(false),
18
+ _React$useState2 = _slicedToArray(_React$useState, 2),
19
+ disabled = _React$useState2[0],
20
+ setDisabled = _React$useState2[1];
17
21
  var _React$useMemo = React.useMemo(function () {
18
22
  var _detailInfo$questionC;
19
23
  var detailInfo = moduleInfo.data.results.askShowInfo;
@@ -32,10 +36,17 @@ var AskCard = function AskCard(_ref) {
32
36
  optionsList: optionsList,
33
37
  questionContent: questionContent
34
38
  };
35
- }, [moduleInfo, handleClickAskList]),
39
+ }, [moduleInfo]),
36
40
  detailInfo = _React$useMemo.detailInfo,
37
41
  optionsList = _React$useMemo.optionsList,
38
42
  questionContent = _React$useMemo.questionContent;
43
+ React.useEffect(function () {
44
+ setDisabled(Boolean(detailInfo.answerType === 0 || item.selectValue));
45
+ }, [detailInfo.answerType, item.selectValue]);
46
+ var onAskItemClick = function onAskItemClick(moduleInfo, option, key, value) {
47
+ setDisabled(true);
48
+ handleClickAskList(moduleInfo, option, key, value);
49
+ };
39
50
  var optionRender = function optionRender(v) {
40
51
  return /*#__PURE__*/React.createElement("span", null, v.value ? v.value : v.key);
41
52
  };
@@ -53,10 +64,10 @@ var AskCard = function AskCard(_ref) {
53
64
  id: item.id
54
65
  })), detailInfo.answerType === 1 && (optionsList === null || optionsList === void 0 ? void 0 : optionsList.map(function (v) {
55
66
  return /*#__PURE__*/React.createElement("div", {
56
- className: classNames(styles.askItem, detailInfo.answerType === 0 || item.selectValue ? styles.disablebox : ''),
67
+ className: classNames(styles.askItem, disabled ? styles.disablebox : ''),
57
68
  key: v.key,
58
69
  onClick: function onClick() {
59
- return handleClickAskList(moduleInfo, 'click', v.key, v.value || v.key);
70
+ return onAskItemClick(moduleInfo, 'click', v.key, v.value || v.key);
60
71
  }
61
72
  }, optionRender(v));
62
73
  })), detailInfo.uploadFile && detailInfo.answerType === 0 && /*#__PURE__*/React.createElement("div", {
@@ -23,8 +23,7 @@ import { IconChevronUp, IconChevronDown } from '@douyinfe/semi-icons';
23
23
  import { useAppSelector, useAppDispatch } from "../../store/hooks";
24
24
  import { setMessageList } from "../../store/slices/gimiMenuSlice";
25
25
  var ReasoningContent = function ReasoningContent(_ref) {
26
- var _ref$reasoningTitle = _ref.reasoningTitle,
27
- reasoningTitle = _ref$reasoningTitle === void 0 ? 'GIMI' : _ref$reasoningTitle,
26
+ var reasoningTitle = _ref.reasoningTitle,
28
27
  item = _ref.item;
29
28
  var containerRef = useRef(null);
30
29
  var _useScroll = useScroll(containerRef),
@@ -194,7 +194,6 @@ var useChatActions = function useChatActions(showCopyId, inputModelRef, handleSe
194
194
  selectValue: key
195
195
  });
196
196
  });
197
- console.log('Fun: handleClickAskList, newMessageList:', newMessageList);
198
197
  dispatch(setMessageList({
199
198
  messageList: newMessageList
200
199
  }));