diff --git a/Adamant/Assets/l18n/de.lproj/Localizable.strings b/Adamant/Assets/l18n/de.lproj/Localizable.strings index f87511432..f07d2ac18 100755 --- a/Adamant/Assets/l18n/de.lproj/Localizable.strings +++ b/Adamant/Assets/l18n/de.lproj/Localizable.strings @@ -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"; diff --git a/Adamant/Assets/l18n/en.lproj/Localizable.strings b/Adamant/Assets/l18n/en.lproj/Localizable.strings index 75a732d80..abbf2a548 100755 --- a/Adamant/Assets/l18n/en.lproj/Localizable.strings +++ b/Adamant/Assets/l18n/en.lproj/Localizable.strings @@ -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"; diff --git a/Adamant/Assets/l18n/ru.lproj/Localizable.strings b/Adamant/Assets/l18n/ru.lproj/Localizable.strings index 718b8930d..f78193f97 100644 --- a/Adamant/Assets/l18n/ru.lproj/Localizable.strings +++ b/Adamant/Assets/l18n/ru.lproj/Localizable.strings @@ -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" = "Баланс"; diff --git a/Adamant/Info.plist b/Adamant/Info.plist index a8b9401de..d50baa474 100644 --- a/Adamant/Info.plist +++ b/Adamant/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4 + 0.4.1 CFBundleVersion - 35 + 36 LSRequiresIPhoneOS NSCameraUsageDescription diff --git a/Adamant/Services/AdamantDialogService.swift b/Adamant/Services/AdamantDialogService.swift index 910e0bbef..533ba5022 100644 --- a/Adamant/Services/AdamantDialogService.swift +++ b/Adamant/Services/AdamantDialogService.swift @@ -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) diff --git a/Adamant/Stories/NodesEditor/NodesListViewController.swift b/Adamant/Stories/NodesEditor/NodesListViewController.swift index 8cbfe8664..5979d9368 100644 --- a/Adamant/Stories/NodesEditor/NodesListViewController.swift +++ b/Adamant/Stories/NodesEditor/NodesListViewController.swift @@ -74,6 +74,7 @@ class NodesListViewController: FormViewController { // Properties private var nodes = [Node]() + private var didResetNodesOnDissapear = false // MARK: - Lifecycle @@ -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) } } @@ -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) + } + } }