From de78c18f36d10d2f5bd381938178485d92e7a7fb Mon Sep 17 00:00:00 2001 From: Anton B Date: Fri, 29 Jun 2018 14:58:11 +0300 Subject: [PATCH 1/4] Fix issue with email composer showing --- Adamant/Services/AdamantDialogService.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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) From d36257135e410aba0ff09f15ae47f87230a8e6c8 Mon Sep 17 00:00:00 2001 From: Pavel Anokhov Date: Tue, 3 Jul 2018 15:01:28 +0300 Subject: [PATCH 2/4] 'Buy tokens' url updated. --- Adamant/Assets/l18n/de.lproj/Localizable.strings | 2 +- Adamant/Assets/l18n/en.lproj/Localizable.strings | 2 +- Adamant/Assets/l18n/ru.lproj/Localizable.strings | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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" = "Баланс"; From 45b202001c2926804f9b051ebd75fa68227f6bc0 Mon Sep 17 00:00:00 2001 From: Pavel Anokhov Date: Tue, 3 Jul 2018 15:37:02 +0300 Subject: [PATCH 3/4] NodesEditor: Loading default nodes fixed. --- .../NodesEditor/NodesListViewController.swift | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) 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) + } + } } From a39d5988c2e06b0e4236f90ed925e7866722e5ae Mon Sep 17 00:00:00 2001 From: Pavel Anokhov Date: Tue, 3 Jul 2018 15:40:41 +0300 Subject: [PATCH 4/4] Version --- Adamant/Info.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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