yt-chat-components 0.9.7 → 0.9.8

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.8",
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",
@@ -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
  }}>