Skip to content

Commit aa4a260

Browse files
authored
refactor(datagrid): consolidate resolvedTableRowsForTab into the existing helper (#936)
resolvedTableRowsForTab(coordinator:tabId:) and resolvedTableRows(for:) returned the same one-liner: coordinator.tableRowsStore.existingTableRows(for: id) ?? TableRows(). The duplicate existed because the dataGridView closure captures [coordinator] and didn't have a QueryTab in scope. Inlined the store read directly in the closure (already a one-liner, no helper needed). Drops the duplicate method. resolvedTableRows(for tab:) stays for the four other call sites that operate on a QueryTab.
1 parent 7c1d844 commit aa4a260

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

TablePro/Views/Main/Child/MainEditorContentView.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ struct MainEditorContentView: View {
518518
let tabId = tab.id
519519
DataGridView(
520520
tableRowsProvider: { [coordinator] in
521-
resolvedTableRowsForTab(coordinator: coordinator, tabId: tabId)
521+
coordinator.tableRowsStore.existingTableRows(for: tabId) ?? TableRows()
522522
},
523523
tableRowsMutator: { [coordinator] mutate in
524524
coordinator.mutateActiveTableRows(for: tabId) { rows in
@@ -557,11 +557,6 @@ struct MainEditorContentView: View {
557557
coordinator.tableRowsStore.existingTableRows(for: tab.id) ?? TableRows()
558558
}
559559

560-
@MainActor
561-
private func resolvedTableRowsForTab(coordinator: MainContentCoordinator, tabId: UUID) -> TableRows {
562-
coordinator.tableRowsStore.existingTableRows(for: tabId) ?? TableRows()
563-
}
564-
565560
private func displayFormats(for tab: QueryTab) -> [ValueDisplayFormat?] {
566561
let tableRows = coordinator.tableRowsStore.existingTableRows(for: tab.id)
567562
let columns = tableRows?.columns ?? []

0 commit comments

Comments
 (0)