Skip to content

Commit df6d004

Browse files
authored
fix: resolve sidebar CancellationError and truncate long toolbar version (#492)
1 parent a9850c7 commit df6d004

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

Plugins/OracleDriverPlugin/OracleConnection.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ final class OracleConnectionWrapper: @unchecked Sendable {
195195
throw OracleError(message: detail)
196196
} catch let error as OracleError {
197197
throw error
198+
} catch is CancellationError {
199+
throw CancellationError()
198200
} catch {
199201
throw OracleError(message: "Query execution failed: \(String(describing: error))")
200202
}

TablePro/ViewModels/SidebarViewModel.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ final class SidebarViewModel {
170170
// MARK: - Table Loading
171171

172172
func loadTables(force: Bool = false) {
173+
loadTask?.cancel()
173174
guard !isLoading else { return }
174175
isLoading = true
175176
errorMessage = nil
@@ -230,6 +231,8 @@ final class SidebarViewModel {
230231
}
231232
}
232233
isLoading = false
234+
} catch is CancellationError {
235+
isLoading = false
233236
} catch {
234237
errorMessage = error.localizedDescription
235238
isLoading = false

TablePro/Views/Toolbar/ConnectionStatusView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ struct ConnectionStatusView: View {
4242
Text(formattedDatabaseInfo)
4343
.font(.system(size: ThemeEngine.shared.activeTheme.typography.small, weight: .regular, design: .monospaced))
4444
.foregroundStyle(ThemeEngine.shared.colors.toolbar.secondaryTextSwiftUI)
45+
.lineLimit(1)
46+
.truncationMode(.middle)
47+
.frame(maxWidth: 280)
4548
.accessibilityLabel(
4649
String(localized: "Database type: \(formattedDatabaseInfo)")
4750
)

0 commit comments

Comments
 (0)