mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-18 11:13:28 +01:00
Add https:// to a source URL if you forget the scheme (#361)
This commit is contained in:
@@ -106,7 +106,12 @@ private extension SourcesViewController
|
|||||||
}
|
}
|
||||||
alertController.addAction(.cancel)
|
alertController.addAction(.cancel)
|
||||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("Add", comment: ""), style: .default) { (action) in
|
alertController.addAction(UIAlertAction(title: NSLocalizedString("Add", comment: ""), style: .default) { (action) in
|
||||||
guard let text = alertController.textFields![0].text, let sourceURL = URL(string: text) else { return }
|
guard let text = alertController.textFields![0].text else { return }
|
||||||
|
guard var sourceURL = URL(string: text) else { return }
|
||||||
|
if sourceURL.scheme == nil {
|
||||||
|
guard let httpsSourceURL = URL(string: "https://" + text) else { return }
|
||||||
|
sourceURL = httpsSourceURL
|
||||||
|
}
|
||||||
self.addSource(url: sourceURL)
|
self.addSource(url: sourceURL)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user