Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions TablePro/Core/Database/DatabaseManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ final class DatabaseManager {
if resolvedConnection.database.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
let adapter = driver as? PluginDriverAdapter,
let savedDb = AppSettingsStorage.shared.loadLastDatabase(for: connection.id) {
try? await adapter.switchDatabase(to: savedDb)
activeSessions[connection.id]?.currentDatabase = savedDb
do {
try await adapter.switchDatabase(to: savedDb)
activeSessions[connection.id]?.currentDatabase = savedDb
} catch {
Self.logger.warning("Failed to restore saved database '\(savedDb, privacy: .public)' for \(connection.id): \(error.localizedDescription, privacy: .public)")
}
}
case .selectDatabaseFromConnectionField(let fieldId):
// Select database from a connection field (e.g. Redis database index).
Expand Down
6 changes: 2 additions & 4 deletions TablePro/Models/UI/RightPanelState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ import os
var isPresented: Bool {
didSet {
guard !isSyncing else { return }
DispatchQueue.main.async { [self] in
UserDefaults.standard.set(self.isPresented, forKey: Self.isPresentedKey)
NotificationCenter.default.post(name: Self.isPresentedChangedNotification, object: self)
}
UserDefaults.standard.set(isPresented, forKey: Self.isPresentedKey)
NotificationCenter.default.post(name: Self.isPresentedChangedNotification, object: self)
}
}

Expand Down
Loading