Skip to content

Commit

Permalink
Merge branch 'release/0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
RealBonus committed Jul 3, 2018
2 parents cb805c7 + a39d598 commit 0028a96
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Adamant/Assets/l18n/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"AccountTab.FreeTokens.UrlFormat" = "https://adamant.im/free-adm-tokens/?wallet=%@";

/* Account tab: A full 'Join ICO' link, with %@ as address */
"AccountTab.JoinIco.UrlFormat" = "https://adamant.im/ico/?wallet=%@";
"AccountTab.JoinIco.UrlFormat" = "https://adamant.im/de-buy-tokens/?wallet=%@";

/* Account tab: Balance row title */
"AccountTab.Row.Balance" = "Kontostand";
Expand Down
2 changes: 1 addition & 1 deletion Adamant/Assets/l18n/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"AccountTab.FreeTokens.UrlFormat" = "https://adamant.im/free-adm-tokens/?wallet=%@";

/* Account tab: A full 'Join ICO' link, with %@ as address */
"AccountTab.JoinIco.UrlFormat" = "https://adamant.im/ico/?wallet=%@";
"AccountTab.JoinIco.UrlFormat" = "https://adamant.im/buy-tokens/?wallet=%@";

/* Account tab: Balance row title */
"AccountTab.Row.Balance" = "Balance";
Expand Down
2 changes: 1 addition & 1 deletion Adamant/Assets/l18n/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"AccountTab.FreeTokens.UrlFormat" = "https://adamant.im/ru-free-adm-tokens/?wallet=%@";

/* Account tab: A full 'Join ICO' link, with %@ as address */
"AccountTab.JoinIco.UrlFormat" = "https://adamant.im/ru-ico/?wallet=%@";
"AccountTab.JoinIco.UrlFormat" = "https://adamant.im/ru-buy-tokens/?wallet=%@";

/* Account tab: Balance row title */
"AccountTab.Row.Balance" = "Баланс";
Expand Down
4 changes: 2 additions & 2 deletions Adamant/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.4</string>
<string>0.4.1</string>
<key>CFBundleVersion</key>
<string>35</string>
<string>36</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
Expand Down
13 changes: 9 additions & 4 deletions Adamant/Services/AdamantDialogService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,24 @@ extension AdamantDialogService {

let supportBtn = PMAlertAction(title: AdamantResources.iosAppSupportEmail, style: .default) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
guard let presenter = self else {
guard let dialogService = self, var presenter = dialogService.getTopmostViewController() else {
print("Lost connecting with dialog service")
return
return
}

// Fix issue when PMAlertController is still top ViewController
if presenter is PMAlertController, let vc = presenter.presentingViewController {
presenter = vc
}

if !MFMailComposeViewController.canSendMail() {
print("Mail services are not available")
presenter.showWarning(withMessage: String.adamantLocalized.alert.noMailService)
dialogService.showWarning(withMessage: String.adamantLocalized.alert.noMailService)
return
}

let mailVC = MFMailComposeViewController()
mailVC.mailComposeDelegate = presenter.mailDelegate
mailVC.mailComposeDelegate = dialogService.mailDelegate
mailVC.setToRecipients([AdamantResources.iosAppSupportEmail])
mailVC.setSubject(String.adamantLocalized.alert.emailErrorMessageTitle)

Expand Down
26 changes: 21 additions & 5 deletions Adamant/Stories/NodesEditor/NodesListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class NodesListViewController: FormViewController {
// Properties

private var nodes = [Node]()
private var didResetNodesOnDissapear = false


// MARK: - Lifecycle
Expand Down Expand Up @@ -143,12 +144,17 @@ class NodesListViewController: FormViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)

// Top, not presented, and no nodes - reset to default and show alert
if let top = navigationController?.topViewController, top == self && presentedViewController == nil && nodes.count == 0 {
let nodes = nodesSource.defaultNodes
nodesSource.nodes = nodes
nodesSource.saveNodes()
dialogService.showSuccess(withMessage: String.adamantLocalized.nodesList.defaultNodesWasLoaded)
didResetNodesOnDissapear = true
loadDefaultNodes(showAlert: true)
}
}

override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)

if navigationController == nil && nodes.count == 0 && !didResetNodesOnDissapear {
loadDefaultNodes(showAlert: true)
}
}

Expand Down Expand Up @@ -298,6 +304,16 @@ extension NodesListViewController {
nodesSource.nodes = nodes
nodesSource.saveNodes()
}

func loadDefaultNodes(showAlert: Bool) {
let nodes = nodesSource.defaultNodes
nodesSource.nodes = nodes
nodesSource.saveNodes()

if showAlert {
dialogService.showSuccess(withMessage: String.adamantLocalized.nodesList.defaultNodesWasLoaded)
}
}
}


Expand Down

0 comments on commit 0028a96

Please sign in to comment.