fix crash when no font is seleccted

This commit is contained in:
neon443 committed 2025-07-17 16:29:57 +01:00
1 parent 50d1aa02af
commit 2363d613bf
3 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ class HostsManager: ObservableObject, @unchecked Sendable {
self.fonts = customFonts self.fonts = customFonts
userDefaults.synchronize() userDefaults.synchronize()
self.selectedFont = userDefaults.string(forKey: "selectedFontName") ?? "Menlo" self.selectedFont = userDefaults.string(forKey: "selectedFontName") ?? "SF Mono"
self.fontSize = CGFloat(userDefaults.double(forKey: "fontSize")) self.fontSize = CGFloat(userDefaults.double(forKey: "fontSize"))
} }
+1
View File
@@ -23,6 +23,7 @@ struct TextBox: View {
} else { } else {
TextField("", text: $text, prompt: Text(prompt)) TextField("", text: $text, prompt: Text(prompt))
.multilineTextAlignment(.trailing) .multilineTextAlignment(.trailing)
.disableAutocorrection(true)
} }
} }
} }
@@ -25,7 +25,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
if window != nil { if window != nil {
restoreScrollback() restoreScrollback()
if let hostsManager { if let hostsManager {
// font = UIFont(name: hostsManager.selectedFont, size: hostsManager.fontSize)! font = UIFont(name: hostsManager.selectedFont, size: hostsManager.fontSize)!
} }
applySelectedTheme() applySelectedTheme()
startFeedLoop() startFeedLoop()
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.