Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ui/src/workflow/nodes/speech-to-text-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<ModelSelect
@wheel="wheel"
:teleported="false"
@change="sttModelChange"
v-model="form_data.stt_model_id"
:placeholder="$t('views.application.form.voiceInput.placeholder')"
:options="modelOptions"
Expand Down Expand Up @@ -192,9 +193,16 @@ const openSTTParamSettingDialog = () => {
}

const refreshSTTForm = (data: any) => {
form_data.value.model_params_setting = data
set(props.nodeModel.properties.node_data, 'model_params_setting', data)
}

function sttModelChange(model_id: string) {
if (model_id) {
STTModeParamSettingDialogRef.value?.reset_default(model_id, id)
} else {
refreshSTTForm({})
}
}

const application = getApplicationDetail()
function getSelectModel() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code appears to be checking out for potential problems but lacks context that would allow comprehensive analysis. However, here are some general tips:

  1. Event Binding: Ensure that the event handler @change is correctly bound within its parent component's scope.

  2. Data Flow: Check how the data flows between different components involved (refreshSTTForm, sttModelChange). Are all necessary variables properly initialized?

  3. Component State Management: If using Vue 3 Composition API, ensure proper state management for dynamic data changes.

  4. Nullish Coalescing Operator: In JavaScript / TypeScript, consider using optional chaining or nullish coalescing operators if dealing with nested properties like props.nodeModel.properties.node_data.

  5. Validation: Add validation checks where appropriate to prevent runtime errors due to missing or unexpected values.

  6. Testing: Implement unit, integration, and end-to-end tests to catch edge cases not covered by regular manual inspection.

If more specific details about the environment, requirements, expected behavior, etc., are provided, I can give more targeted feedback.

Expand Down
Loading