Skip to content

Commit 0ade5e6

Browse files
committed
Replace strict equality checks with loose equality checks for string comparisons
1 parent 2b55586 commit 0ade5e6

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/editor/src/views/panel/backend/message-handlers/handle-voice-input.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const stop_recording = async (panel_provider: PanelProvider) => {
238238
})
239239

240240
if (result?.response) {
241-
if (result.response.trim().toUpperCase() === 'INAUDIBLE') {
241+
if (result.response.trim().toUpperCase() == 'INAUDIBLE') {
242242
panel_provider.send_message({
243243
command: 'SHOW_AUTO_CLOSING_MODAL',
244244
title: 'Inaudible voice input',

‎packages/ui/src/components/editor/panel/prompts/PromptField/hooks/use-handlers/handle-key-down.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ export const create_handle_key_down = (
7474
const value = refs.props_ref.current.value
7575

7676
if (
77-
current_raw_pos >= 2 &&
78-
value.substring(current_raw_pos - 2, current_raw_pos) == ' '
77+
(current_raw_pos >= 2 &&
78+
value.substring(current_raw_pos - 2, current_raw_pos) == ' ') ||
79+
(current_raw_pos == 1 && value.charAt(0) == ' ')
7980
) {
8081
const new_value =
8182
value.substring(0, current_raw_pos - 1) +

0 commit comments

Comments
 (0)