Skip to content

Commit d41d197

Browse files
committed
fix: complete hasStructureChanges writer migration, fix localization, remove dead writes
1 parent 7e60546 commit d41d197

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

TablePro/TableProApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ struct AppMenuCommands: Commands {
216216
actions?.previewSQL()
217217
} label: {
218218
if let dbType = actions?.currentDatabaseType {
219-
Text("Preview \(PluginManager.shared.queryLanguageName(for: dbType))")
219+
Text(String(format: String(localized: "Preview %@"), PluginManager.shared.queryLanguageName(for: dbType)))
220220
} else {
221221
Text("Preview SQL")
222222
}

TablePro/Views/Main/MainContentCommandActions.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,7 @@ final class MainContentCommandActions {
382382
}
383383
coordinator?.tabManager.tabs.removeAll()
384384
coordinator?.tabManager.selectedTabId = nil
385-
AppState.shared.isCurrentTabEditable = false
386385
coordinator?.toolbarState.isTableTab = false
387-
AppState.shared.isTableTab = false
388386
}
389387
}
390388

TablePro/Views/Structure/TableStructureView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct TableStructureView: View {
7474
.onAppear {
7575
AppState.shared.isCurrentTabEditable = (selectedTab != .ddl)
7676
AppState.shared.hasRowSelection = !selectedRows.isEmpty
77-
AppState.shared.hasStructureChanges = structureChangeManager.hasChanges
77+
coordinator?.toolbarState.hasStructureChanges = structureChangeManager.hasChanges
7878

7979
// Wire action handler for direct coordinator calls
8080
actionHandler.saveChanges = {
@@ -92,11 +92,11 @@ struct TableStructureView: View {
9292
.onDisappear {
9393
AppState.shared.isCurrentTabEditable = false
9494
AppState.shared.hasRowSelection = false
95-
AppState.shared.hasStructureChanges = false
95+
coordinator?.toolbarState.hasStructureChanges = false
9696
coordinator?.structureActions = nil
9797
}
9898
.onChange(of: structureChangeManager.hasChanges) { _, newValue in
99-
AppState.shared.hasStructureChanges = newValue
99+
coordinator?.toolbarState.hasStructureChanges = newValue
100100
}
101101
.onReceive(NotificationCenter.default.publisher(for: .refreshData), perform: onRefreshData)
102102
}

0 commit comments

Comments
 (0)