@@ -11,6 +11,7 @@ import {
1111 goToPreviousQuery ,
1212 selectQueriesHistory ,
1313 selectUserInput ,
14+ setIsDirty ,
1415} from '../../../../store/reducers/query/query' ;
1516import type { QueryAction } from '../../../../types/store/query' ;
1617import { ENABLE_CODE_ASSISTANT , LAST_USED_QUERY_ACTION_KEY } from '../../../../utils/constants' ;
@@ -32,7 +33,7 @@ import {getKeyBindings} from './keybindings';
3233const CONTEXT_MENU_GROUP_ID = 'navigation' ;
3334
3435interface YqlEditorProps {
35- changeUserInput : ( arg : { input : string ; isDirty ?: boolean } ) => void ;
36+ changeUserInput : ( arg : { input : string } ) => void ;
3637 theme : string ;
3738 handleGetExplainQueryClick : ( text : string ) => void ;
3839 handleSendExecuteClick : ( text : string , partial ?: boolean ) => void ;
@@ -92,7 +93,8 @@ export function YqlEditor({
9293 window . ydbEditor = editor ;
9394 const keybindings = getKeyBindings ( monaco ) ;
9495 monaco . editor . registerCommand ( 'insertSnippetToEditor' , ( _asessor , input : string ) => {
95- changeUserInput ( { input, isDirty : false } ) ;
96+ changeUserInput ( { input} ) ;
97+ dispatch ( setIsDirty ( false ) ) ;
9698 } ) ;
9799
98100 if ( window . api . codeAssist ) {
@@ -179,7 +181,8 @@ export function YqlEditor({
179181
180182 const onChange = ( newValue : string ) => {
181183 updateErrorsHighlighting ( ) ;
182- changeUserInput ( { input : newValue , isDirty : true } ) ;
184+ changeUserInput ( { input : newValue } ) ;
185+ dispatch ( setIsDirty ( true ) ) ;
183186 } ;
184187 return (
185188 < MonacoEditor
0 commit comments