Skip to content

Commit 3df1427

Browse files
committed
Revert "fix: prevent sidebar clearing when opening new query tab (#576)"
This reverts commit 905aff8.
1 parent 8a1d6df commit 3df1427

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

TablePro/Models/Query/EditorTabPayload.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ internal struct EditorTabPayload: Codable, Hashable {
9393
/// Whether this payload is a "connection-only" payload — just a connectionId
9494
/// with no specific tab content. Used by MainContentView to decide whether
9595
/// to create a default tab or restore tabs from storage.
96-
/// Note: isNewTab payloads (from the "+" button) are NOT connection-only —
97-
/// they are explicit requests to open a new query tab.
9896
internal var isConnectionOnly: Bool {
99-
tabType == .query && tableName == nil && initialQuery == nil && !isNewTab
97+
tabType == .query && tableName == nil && initialQuery == nil
10098
}
10199

102100
/// Create a payload from a persisted QueryTab for restoration

TablePro/Views/Main/MainContentView.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,7 @@ struct MainContentView: View {
450450
private func initializeAndRestoreTabs() async {
451451
guard !hasInitialized else { return }
452452
hasInitialized = true
453-
454-
// Only load schema if this is the first window for this connection.
455-
// Additional windows share the same driver — concurrent schema load
456-
// races with health monitor pings and can crash single-connection drivers.
457-
if !WindowLifecycleMonitor.shared.hasOtherWindows(for: connection.id, excluding: windowId) {
458-
Task { await coordinator.loadSchemaIfNeeded() }
459-
}
453+
Task { await coordinator.loadSchemaIfNeeded() }
460454

461455
// If payload provided a specific tab (not connection-only), execute its query immediately
462456
if let payload, !payload.isConnectionOnly {

0 commit comments

Comments
 (0)