fix(sidebar): centralize tree action handling
This commit is contained in:
1 parent
7f096653db
commit
ee85033068
28 files changed
+2705
-1032
No files matched your search
@@ -4,8 +4,8 @@ function isErrorResult(result: QueryResult | undefined): boolean {
|
||||
return result?.columns.length === 1 && result.columns[0] === "Error";
|
||||
}
|
||||
|
||||
export function canActivateExistingDataTableTab(tab: QueryTab): boolean {
|
||||
if (tab.isExecuting) return true;
|
||||
export function canActivateExistingDataTableTab(tab: QueryTab, options: { activateExecuting?: boolean } = {}): boolean {
|
||||
if (tab.isExecuting) return options.activateExecuting !== false;
|
||||
if (isErrorResult(tab.result)) return false;
|
||||
return !!tab.result || !!tab.results?.length;
|
||||
}
|
||||
Reference in new issue
Block a user