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
|
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"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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