fix(tabs): close connection tabs on disconnect
This commit is contained in:
1 parent
53239d91fb
commit
2ff4a3fd97
4 files changed
+109
-15
No files matched your search
@@ -2151,12 +2151,16 @@ function editConnection() {
|
||||
}
|
||||
}
|
||||
|
||||
function disconnectConnection() {
|
||||
async function disconnectConnection() {
|
||||
if (props.node.connectionId) {
|
||||
connectionStore.disconnect(props.node.connectionId);
|
||||
props.node.isExpanded = false;
|
||||
props.node.children = [];
|
||||
toast(t("connection.disconnected"), 2000);
|
||||
try {
|
||||
await connectionStore.disconnect(props.node.connectionId);
|
||||
props.node.isExpanded = false;
|
||||
props.node.children = [];
|
||||
toast(t("connection.disconnected"), 2000);
|
||||
} catch (e: any) {
|
||||
toast(t("connection.saveFailed", { message: e?.message || String(e) }), 5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2165,7 +2169,6 @@ async function closeDatabaseConnection() {
|
||||
if (node.type !== "database" || !node.connectionId || node.database == null) return;
|
||||
try {
|
||||
await connectionStore.closeDatabaseConnection(node.connectionId, node.database);
|
||||
queryStore.closeDatabaseTabs(node.connectionId, node.database);
|
||||
toast(t("connection.databaseConnectionClosed", { name: node.label }), 2000);
|
||||
} catch (e: any) {
|
||||
toast(t("connection.saveFailed", { message: e?.message || String(e) }), 5000);
|
||||
|
||||
Reference in new issue
Block a user