Skip to content

Commit fde8a18

Browse files
committed
Remove missing configuration warnings from prompt handlers
- [Fragment] returns null but [Fragment] returns undefined, we prefer to return undefined ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── backend │ └── message-handlers │ ├── handle-autofill.ts │ └── handle-make-api-call.ts └── packages └── ui └── src └── components └── editor ├── common │ └── prompts │ ├── PromptField │ │ ├── PromptField.module.scss │ │ ├── PromptField.stories.tsx │ │ ├── PromptField.tsx │ │ ├── hooks │ │ │ ├── use-drag-drop.ts │ │ │ ├── use-dropdown.ts │ │ │ ├── use-ghost-text.ts │ │ │ ├── use-handlers │ │ │ │ ├── handle-copy.ts │ │ │ │ ├── handle-cut.ts │ │ │ │ ├── handle-input-change.ts │ │ │ │ ├── handle-input-click.ts │ │ │ │ ├── handle-key-down.ts │ │ │ │ ├── handle-paste.ts │ │ │ │ ├── handle-submit.ts │ │ │ │ ├── index.ts │ │ │ │ ├── types.ts │ │ │ │ ├── use-handlers.ts │ │ │ │ └── utils.ts │ │ │ └── use-keyboard-shortcuts.ts │ │ └── index.ts │ ├── Template │ │ ├── Template.module.scss │ │ ├── Template.tsx │ │ └── index.ts │ └── shared │ └── symbols │ ├── caret.ts │ ├── get-highlighted-text.tsx │ ├── index.ts │ ├── position-mapping.ts │ ├── prompt-symbols.module.scss │ ├── reconstruct-raw-value.ts │ └── use-symbol-deletion.ts └── prompt └── Configurations ├── Configurations.module.scss └── Configurations.tsx
1 parent adffa80 commit fde8a18

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎apps/editor/src/views/prompt/backend/message-handlers/handle-autofill.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
import { handle_update_last_used_web_configuration } from './handle-update-last-used-web-configuration'
1616
import { show_configurations_quick_pick } from '@/utils/show-configurations-quick-pick'
1717
import { PromptBuilder } from '@/utils/prompt-builder'
18-
import { show_no_configurations_warning } from '@/utils/show-no-configurations-warning'
1918
import { t } from '@/i18n'
2019

2120
export const handle_autofill = async (params: {
@@ -125,7 +124,7 @@ const show_web_configuration_quick_pick = async (params: {
125124
get_is_web_configuration_disabled: (
126125
web_configuration: ConfigWebConfigurationFormat
127126
) => boolean
128-
}): Promise<{ web_configuration_name: string | undefined } | null> => {
127+
}): Promise<{ web_configuration_name: string | undefined } | undefined> => {
129128
const {
130129
web_configurations,
131130
extension_context,
@@ -136,8 +135,7 @@ const show_web_configuration_quick_pick = async (params: {
136135
const valid_web_configurations = web_configurations.filter((c) => c.chatbot)
137136

138137
if (valid_web_configurations.length == 0) {
139-
show_no_configurations_warning('web')
140-
return null
138+
return
141139
}
142140

143141
const recents_key = get_last_used_web_configuration_key(prompt_type)
@@ -153,13 +151,13 @@ const show_web_configuration_quick_pick = async (params: {
153151

154152
if (!result || result === 'back') {
155153
prompt_view_provider.send_message({ command: 'FOCUS_PROMPT_FIELD' })
156-
return null
154+
return
157155
}
158156

159157
const web_configuration = result.item
160158

161159
if (params.get_is_web_configuration_disabled(web_configuration)) {
162-
return null
160+
return
163161
}
164162

165163
if (web_configuration.name) {

‎apps/editor/src/views/prompt/backend/message-handlers/handle-make-api-call.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { dictionary } from '@shared/constants/dictionary'
1818
import { default_system_instructions } from '@shared/constants/default-system-instructions'
1919
import { build_user_content } from '@/utils/build-user-content'
2020
import { show_configurations_quick_pick } from '@/utils/show-configurations-quick-pick'
21-
import { show_no_configurations_warning } from '@/utils/show-no-configurations-warning'
2221
import { PromptBuilder } from '@/utils/prompt-builder'
2322
import { ApiPromptType } from '@shared/types/prompt-types'
2423
import {
@@ -47,7 +46,6 @@ const get_api_configuration = async (params: {
4746
await params.providers_manager.get_api_configurations()
4847

4948
if (api_configurations.length == 0) {
50-
show_no_configurations_warning('api')
5149
return
5250
}
5351

0 commit comments

Comments
 (0)