diff --git a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx index 77309c68445cd..f74249465456a 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx @@ -104,15 +104,14 @@ export default function SqlEditorLeftBar({ // Ref needed to avoid infinite rerenders on handlers // that require and modify the queryEditor const queryEditorRef = useRef(queryEditor); - const [isDbSearch, setDbSearch] = useState(false); + const [emptyResultsWithSearch, setEmptyResultsWithSearch] = useState(false); useEffect(() => { queryEditorRef.current = queryEditor; }, [queryEditor]); - const onDbSearch = (searchText?: string) => { - if (searchText) setDbSearch(true); - else setDbSearch(false); + const onEmptyResults = (searchText?: string) => { + setEmptyResultsWithSearch(!!searchText); }; const onDbChange = ({ id: dbId }: { id: number }) => { @@ -188,7 +187,7 @@ export default function SqlEditorLeftBar({