fix(sidebar): handle double-click on saved SQL files
- Add missing 'open-saved-sql' action handler in onDoubleClick - Add openSavedSqlFile() function to open saved SQL files - Fixes issue where double-clicking saved SQL files did nothing when sidebarActivation is set to 'double' mode Fixes #1636
This commit is contained in:
1 parent
a36d2f12f7
commit
f29d393c37
1 file changed
+12
@@ -776,6 +776,8 @@ function onDoubleClick() {
|
||||
openData();
|
||||
} else if (action === "open-source") {
|
||||
void viewObjectSource();
|
||||
} else if (action === "open-saved-sql") {
|
||||
openSavedSqlFile();
|
||||
} else if (action === "toggle" && props.node.type === "mongo-collection") {
|
||||
openMongoCollectionData(props.node);
|
||||
} else if (action === "toggle") {
|
||||
@@ -790,6 +792,16 @@ function openMongoCollectionData(node: TreeNode) {
|
||||
queryStore.updateSql(tab, node.label);
|
||||
}
|
||||
|
||||
function openSavedSqlFile() {
|
||||
const node = props.node;
|
||||
if (node.type !== "saved-sql-file" || !node.savedSqlId) return;
|
||||
const file = savedSqlStore.getFile(node.savedSqlId);
|
||||
if (!file) return;
|
||||
queryStore.openSavedSql(file);
|
||||
connectionStore.activeConnectionId = file.connectionId;
|
||||
void savedSqlStore.recordFileUsage(file.id);
|
||||
}
|
||||
|
||||
async function openObjectBrowser() {
|
||||
const node = props.node;
|
||||
if (!node.connectionId) return;
|
||||
|
||||
Reference in new issue
Block a user