File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
components/webui/client/src/components/SqlInput Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ type SqlInputProps = SqlEditorProps & {
2929 */
3030const SqlInput = ( props : SqlInputProps ) => {
3131 const { validateFn, ...editorProps } = props ;
32- const editorRef = useRef < SqlEditorType | null > ( null ) ;
32+ const editorRef = useRef < Nullable < SqlEditorType > > ( null ) ;
3333
3434 const handleEditorReady = useCallback ( ( editor : SqlEditorType ) => {
3535 editorRef . current = editor ;
@@ -62,21 +62,19 @@ const SqlInput = (props: SqlInputProps) => {
6262 // Validate SQL and update markers whenever value changes
6363 useEffect ( ( ) => {
6464 const editor = editorRef . current ;
65- if ( ! editor ) {
65+ if ( null === editor ) {
6666 return ;
6767 }
6868
6969 const model = editor . getModel ( ) ;
70- if ( ! model ) {
70+ if ( null === model ) {
7171 return ;
7272 }
7373
74- const value = "string" === typeof editorProps . value ?
75- editorProps . value :
76- "" ;
74+ const value = editorProps . value ?? "" ;
7775
7876 // Clear markers if no validation function or empty/whitespace-only input
79- if ( ! validateFn || ! value . trim ( ) ) {
77+ if ( "undefined" === typeof validateFn || "" === value . trim ( ) ) {
8078 monaco . editor . setModelMarkers ( model , "sql-parser" , [ ] ) ;
8179
8280 return ;
You can’t perform that action at this time.
0 commit comments