Skip to content

Commit 5e0ced9

Browse files
committed
fix: break alert loop when connection lost during lazy-load retry
1 parent 793ed4a commit 5e0ced9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

TablePro/Views/Main/MainContentView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,14 @@ struct MainContentView: View {
336336
// Skip if the user has unsaved changes (in-memory or tab-level).
337337
let hasPendingEdits = changeManager.hasChanges
338338
|| (tabManager.selectedTab?.pendingChanges.hasChanges ?? false)
339+
let isConnected = DatabaseManager.shared.activeSessions[connection.id]?.isConnected ?? false
339340
let needsLazyLoad = tabManager.selectedTab.map { tab in
340341
tab.tabType == .table
341342
&& (tab.resultRows.isEmpty || tab.rowBuffer.isEvicted)
342343
&& (tab.lastExecutedAt == nil || tab.rowBuffer.isEvicted)
343344
&& !tab.query.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
344345
} ?? false
345-
if needsLazyLoad && !hasPendingEdits {
346+
if needsLazyLoad && !hasPendingEdits && isConnected {
346347
coordinator.runQuery()
347348
}
348349
}

0 commit comments

Comments
 (0)