mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-23 09:23:26 +00:00
fix(connection): allow deleting broken connections
This commit is contained in:
@@ -1100,11 +1100,14 @@ function deleteConnection() {
|
||||
async function confirmDelete() {
|
||||
const targets = connectionDeleteTargets();
|
||||
if (!targets.length) return;
|
||||
const connectionIds = targets.map((target) => target.connectionId);
|
||||
try {
|
||||
for (const target of targets) {
|
||||
await connectionStore.disconnect(target.connectionId);
|
||||
await connectionStore.removeConnections(connectionIds);
|
||||
for (const connectionId of connectionIds) {
|
||||
connectionStore.disconnect(connectionId).catch((error) => {
|
||||
console.warn("[DBX][connection:delete:disconnect-failed]", { connectionId, error });
|
||||
});
|
||||
}
|
||||
await connectionStore.removeConnections(targets.map((target) => target.connectionId));
|
||||
toast(targets.length > 1 ? t("connection.deletedSelected", { count: targets.length }) : t("connection.deleted"), 2000);
|
||||
} catch (e: any) {
|
||||
toast(t("connection.saveFailed", { message: e?.message || String(e) }), 5000);
|
||||
|
||||
Reference in New Issue
Block a user