Skip to content

Commit

Permalink
Merge branch 'hotfix/0.3.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
RealBonus committed Jun 21, 2018
2 parents bcb666c + 6548741 commit ac59bd9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Adamant/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ struct AdamantResources {
static let nodes: [Node] = [
Node(scheme: .https, host: "endless.adamant.im", port: nil),
Node(scheme: .https, host: "clown.adamant.im", port: nil),
Node(scheme: .https, host: "lake.adamant.im", port: nil),
Node(scheme: .https, host: "158.69.59.45", port: nil),
Node(scheme: .https, host: "54.36.183.233", port: nil)
Node(scheme: .https, host: "lake.adamant.im", port: nil)
]

static let iosAppSupportEmail = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion Adamant/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>0.3.12</string>
<key>CFBundleVersion</key>
<string>30</string>
<string>31</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
Expand Down
24 changes: 23 additions & 1 deletion Adamant/Stories/NodesEditor/NodeEditorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,29 @@ class NodeEditorViewController: FormViewController {
// MARK: - Actions
extension NodeEditorViewController {
func testNode(completion: ((Bool) -> Void)? = nil) {
guard let url = node?.asURL() else {
var components = URLComponents()

// Host
if let row: TextRow = form.rowBy(tag: Rows.host.tag), let host = row.value {
components.host = host
}

// Scheme
if let row = form.rowBy(tag: Rows.scheme.tag), let scheme = row.baseValue as? URLScheme {
components.scheme = scheme.rawValue
} else {
components.scheme = "https"
}

// Port
if let row: IntRow = form.rowBy(tag: Rows.port.tag), let port = row.value {
components.port = port
}

let url: URL
do {
url = try components.asURL()
} catch {
testState = .failed
dialogService.showWarning(withMessage: String.adamantLocalized.nodesEditor.failedToBuildURL)
return
Expand Down

0 comments on commit ac59bd9

Please sign in to comment.