Insert gemini protocol into host-only URLs
This commit is contained in:
parent
e27ac15635
commit
71831e58f2
|
@ -77,8 +77,11 @@ class NavigationBarView: UIView {
|
|||
|
||||
@objc private func commitURL() {
|
||||
textField.resignFirstResponder()
|
||||
if let text = textField.text, let url = URL(string: text) {
|
||||
navigator.changeURL(url)
|
||||
if let text = textField.text, var components = URLComponents(string: text) {
|
||||
if components.scheme == nil {
|
||||
components.scheme = "gemini"
|
||||
}
|
||||
navigator.changeURL(components.url!)
|
||||
} else {
|
||||
textField.text = navigator.displayURL
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue