feat(sqllab): non-blocking persistence mode (#24539)

Co-authored-by: Justin Park <justinpark@apache.org>
This commit is contained in:
JUST.in DO IT
2023-11-20 11:13:54 -08:00
committed by GitHub
parent 628cd345f2
commit e2bfb1216b
20 changed files with 746 additions and 433 deletions

View File

@@ -557,10 +557,9 @@ const SqlEditor: React.FC<Props> = ({
[setQueryEditorAndSaveSql],
);
const onSqlChanged = (sql: string) => {
const onSqlChanged = useEffectEvent((sql: string) => {
dispatch(queryEditorSetSql(queryEditor, sql));
setQueryEditorAndSaveSqlWithDebounce(sql);
};
});
// Return the heights for the ace editor and the south pane as an object
// given the height of the sql editor, north pane percent and south pane percent.
@@ -785,7 +784,7 @@ const SqlEditor: React.FC<Props> = ({
)}
<AceEditorWrapper
autocomplete={autocompleteEnabled}
onBlur={setQueryEditorAndSaveSql}
onBlur={onSqlChanged}
onChange={onSqlChanged}
queryEditorId={queryEditor.id}
height={`${aceEditorHeight}px`}