mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
fix crash when no font is seleccted
This commit is contained in:
@@ -44,7 +44,7 @@ class HostsManager: ObservableObject, @unchecked Sendable {
|
||||
self.fonts = customFonts
|
||||
|
||||
userDefaults.synchronize()
|
||||
self.selectedFont = userDefaults.string(forKey: "selectedFontName") ?? "Menlo"
|
||||
self.selectedFont = userDefaults.string(forKey: "selectedFontName") ?? "SF Mono"
|
||||
self.fontSize = CGFloat(userDefaults.double(forKey: "fontSize"))
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ struct TextBox: View {
|
||||
} else {
|
||||
TextField("", text: $text, prompt: Text(prompt))
|
||||
.multilineTextAlignment(.trailing)
|
||||
.disableAutocorrection(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
||||
if window != nil {
|
||||
restoreScrollback()
|
||||
if let hostsManager {
|
||||
// font = UIFont(name: hostsManager.selectedFont, size: hostsManager.fontSize)!
|
||||
font = UIFont(name: hostsManager.selectedFont, size: hostsManager.fontSize)!
|
||||
}
|
||||
applySelectedTheme()
|
||||
startFeedLoop()
|
||||
|
||||
Reference in New Issue
Block a user