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() {
|
@objc private func commitURL() {
|
||||||
textField.resignFirstResponder()
|
textField.resignFirstResponder()
|
||||||
if let text = textField.text, let url = URL(string: text) {
|
if let text = textField.text, var components = URLComponents(string: text) {
|
||||||
navigator.changeURL(url)
|
if components.scheme == nil {
|
||||||
|
components.scheme = "gemini"
|
||||||
|
}
|
||||||
|
navigator.changeURL(components.url!)
|
||||||
} else {
|
} else {
|
||||||
textField.text = navigator.displayURL
|
textField.text = navigator.displayURL
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue