Skip to content

Commit 943545c

Browse files
committed
fix: scope auto-reconnect failure cleanup to connection and document runtime toggle
1 parent aef63c8 commit 943545c

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

TablePro/AppDelegate+WindowConfig.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,18 +365,21 @@ extension AppDelegate {
365365
window.close()
366366
}
367367
} catch is CancellationError {
368-
for window in NSApp.windows where self.isMainWindow(window) {
368+
for window in WindowLifecycleMonitor.shared.windows(for: connection.id) {
369369
window.close()
370370
}
371-
self.openWelcomeWindow()
371+
if !NSApp.windows.contains(where: { self.isMainWindow($0) && $0.isVisible }) {
372+
self.openWelcomeWindow()
373+
}
372374
} catch {
373375
windowLogger.error("Auto-reconnect failed for '\(connection.name)': \(error.localizedDescription)")
374376

375-
for window in NSApp.windows where self.isMainWindow(window) {
377+
for window in WindowLifecycleMonitor.shared.windows(for: connection.id) {
376378
window.close()
377379
}
378-
379-
self.openWelcomeWindow()
380+
if !NSApp.windows.contains(where: { self.isMainWindow($0) && $0.isVisible }) {
381+
self.openWelcomeWindow()
382+
}
380383
}
381384
}
382385
}

docs/customization/settings.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ Preview tabs show "Preview" in the subtitle and are not persisted across restart
303303

304304
By default, each database connection opens its own window — tabs for the same connection are grouped together, while different connections get separate windows. Enable this setting to group all tabs into a single window regardless of which connection they belong to.
305305

306+
The setting takes effect for newly opened connections. Existing windows keep their current grouping until closed.
307+
306308
## Keyboard Settings
307309

308310
Customize keyboard shortcuts for menu actions. See [Keyboard Shortcuts](/features/keyboard-shortcuts#customizing-shortcuts) for full details.

0 commit comments

Comments
 (0)