yt-chat-components 0.9.7 → 0.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-chat-components",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "main": "build/static/js/bundle.min.js",
5
5
  "module": "build/static/js/bundle.min.js",
6
6
  "types": "build/static/js/index.d.ts",
@@ -160,7 +160,7 @@ export default function ChatWindow({
160
160
  } else if (event == 'token') {
161
161
  setNowAIContent((prevState) => prevState + data['chunk']);
162
162
  if (lastMessage.current) lastMessage.current.scrollIntoView({ behavior: 'smooth' });
163
- } else if (false && event == 'end') {// 移除end事件的响应
163
+ } else if (event == 'end') {
164
164
  const res = {
165
165
  data: data['result'],
166
166
  };
@@ -355,7 +355,7 @@ export class ToolDialog extends React.Component {
355
355
  // 单独组件情况
356
356
  if(isRefreshWords){
357
357
  this.getFlowInfo().then(currentFlow=>{
358
- const dropDownList = this.getDropDownList(currentFlow.welcome_words||[]);
358
+ const dropDownList = this.getDropDownList(currentFlow?.welcome_words||[]);
359
359
  this.setState({ dropDownList, currentFlow })
360
360
  })
361
361
  }
@@ -365,7 +365,7 @@ export class ToolDialog extends React.Component {
365
365
  }else{
366
366
  const currentScene = sceneData||this.state.sceneInfo;
367
367
  const currentFlow = currentScene.flows[0];
368
- const dropDownList = this.getDropDownList(currentFlow.welcome_words||[]);
368
+ const dropDownList = this.getDropDownList(currentFlow?.welcome_words||[]);
369
369
  if(!isEmpty(sceneData)){
370
370
  this.setState({ currentFlow, dropDownList })
371
371
  }else if(isEmpty(this.state.sceneInfo)){
@@ -400,7 +400,7 @@ export class ToolDialog extends React.Component {
400
400
  return;
401
401
  }
402
402
  this.setState({ sessionId: uuidv4() });
403
- this.setState({ dropDownList: this.getDropDownList(this.state.currentFlow.welcome_words||[]) })
403
+ this.setState({ dropDownList: this.getDropDownList(this.state.currentFlow?.welcome_words||[]) })
404
404
  }
405
405
 
406
406
  updateSessionId = (sessionId) => {
@@ -540,7 +540,7 @@ export class ToolDialog extends React.Component {
540
540
  this.setState({
541
541
  sessionId: uuidv4(),
542
542
  currentFlow: item,
543
- dropDownList: this.getDropDownList(item.welcome_words)
543
+ dropDownList: this.getDropDownList(item?.welcome_words||[])
544
544
  });
545
545
  this.getCurrentFlowHistory(item.id);
546
546
  }}>