Skip to content

Commit

Permalink
fix: null schema issue in saved queries (#18849)
Browse files Browse the repository at this point in the history
  • Loading branch information
codemaster08240328 authored Feb 25, 2022
1 parent fd4bd1e commit 79633ce
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface actionsTypes {
addTable: (queryEditor: any, value: any, schema: any) => void;
setDatabases: (arg0: any) => {};
addDangerToast: (msg: string) => void;
queryEditorSetSchema: (schema?: string) => void;
queryEditorSetSchema: (queryEditor: QueryEditor, schema?: string) => void;
queryEditorSetSchemaOptions: () => void;
queryEditorSetTableOptions: (options: Array<any>) => void;
resetState: () => void;
Expand Down Expand Up @@ -132,14 +132,18 @@ export default function SqlEditorLeftBar({
const shouldShowReset = window.location.search === '?reset=1';
const tableMetaDataHeight = height - 130; // 130 is the height of the selects above

const onSchemaChange = (schema: string) => {
actions.queryEditorSetSchema(queryEditor, schema);
};

return (
<div className="SqlEditorLeftBar">
<TableSelector
database={database}
getDbList={actions.setDatabases}
handleError={actions.addDangerToast}
onDbChange={onDbChange}
onSchemaChange={actions.queryEditorSetSchema}
onSchemaChange={onSchemaChange}
onSchemasLoad={actions.queryEditorSetSchemaOptions}
onTableChange={onTableChange}
onTablesLoad={actions.queryEditorSetTableOptions}
Expand Down

0 comments on commit 79633ce

Please sign in to comment.