diff --git a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj index 994e8a386a..fc57ce6717 100644 --- a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj +++ b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj @@ -10187,7 +10187,7 @@ repositoryURL = "https://github.com/horizontalsystems/MarketKit.Swift"; requirement = { kind = exactVersion; - version = 2.0.9; + version = 2.0.10; }; }; D3604E7128F03B0A0066C366 /* XCRemoteSwiftPackageReference "ScanQrKit.Swift" */ = { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/ActivateSubscription/ActivateSubscriptionViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/ActivateSubscription/ActivateSubscriptionViewController.swift index a5c780ad06..939d5e00ea 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/ActivateSubscription/ActivateSubscriptionViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/ActivateSubscription/ActivateSubscriptionViewController.swift @@ -127,7 +127,7 @@ class ActivateSubscriptionViewController: ThemeViewController { viewModel.finishPublisher .receive(on: DispatchQueue.main) .sink { [weak self] in - HudHelper.instance.showSuccessBanner() + HudHelper.instance.show(banner: .success(string: "activate_subscription.activated".localized)) self?.dismiss(animated: true) } .store(in: &cancellables) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookService.swift index 8b0f2d3c29..1556ac791f 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookService.swift @@ -98,8 +98,8 @@ extension ContactBookService { try contactManager.backupContacts(from: url) } - func replace(contacts: [BackupContact]) { - try? contactManager.restore(contacts: contacts) + func replace(contacts: [BackupContact]) throws { + try contactManager.restore(contacts: contacts) } func blockchainName(blockchainUid: String) -> String? { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookViewController.swift index 748ebca458..62872380e0 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookViewController.swift @@ -88,9 +88,9 @@ class ContactBookViewController: ThemeSearchViewController { subscribe(disposeBag, viewModel.viewItemsDriver) { [weak self] in self?.onUpdate(viewItems: $0) } subscribe(disposeBag, viewModel.emptyListDriver) { [weak self] in self?.set(emptyList: $0) } subscribe(disposeBag, viewModel.showRestoreAlertSignal) { [weak self] in self?.showRestoreAlert(contacts: $0) } - subscribe(disposeBag, viewModel.showSuccessfulRestoreSignal) { HudHelper.instance.showSuccessBanner() } + subscribe(disposeBag, viewModel.showSuccessfulRestoreSignal) { HudHelper.instance.show(banner: .success(string: "contacts.restore.restored".localized)) } subscribe(disposeBag, viewModel.showParsingErrorSignal) { [weak self] in self?.showParsingError() } - subscribe(disposeBag, viewModel.showStorageErrorSignal) { [weak self] in self?.showStorageError() } + subscribe(disposeBag, viewModel.showRestoreErrorSignal) { [weak self] in self?.showRestoreError() } tableView.buildSections() @@ -131,8 +131,8 @@ class ContactBookViewController: ThemeSearchViewController { HudHelper.instance.show(banner: .error(string: "contacts.restore.parsing_error".localized)) } - private func showStorageError() { - HudHelper.instance.show(banner: .error(string: "contacts.restore.storage_error".localized)) + private func showRestoreError() { + HudHelper.instance.show(banner: .error(string: "contacts.restore.restore_error".localized)) } @objc private func onTapMore() { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookViewModel.swift index 3b1b89b483..ea2ee66fef 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/ContactBook/ContactBookList/ContactBookViewModel.swift @@ -20,7 +20,7 @@ class ContactBookViewModel { private let showRestoreAlertRelay = PublishRelay<[BackupContact]>() private let showSuccessfulRestoreRelay = PublishRelay<()>() private let showParsingErrorRelay = PublishRelay<()>() - private let showStorageErrorRelay = PublishRelay<()>() + private let showRestoreErrorRelay = PublishRelay<()>() init(service: ContactBookService) { self.service = service @@ -83,8 +83,8 @@ extension ContactBookViewModel { showParsingErrorRelay.asSignal() } - var showStorageErrorSignal: Signal<()> { - showStorageErrorRelay.asSignal() + var showRestoreErrorSignal: Signal<()> { + showRestoreErrorRelay.asSignal() } func contactAddress(contactUid: String, blockchainUid: String) -> ContactAddress? { @@ -111,7 +111,12 @@ extension ContactBookViewModel { } func replace(contacts: [BackupContact]) { - service.replace(contacts: contacts) + do { + try service.replace(contacts: contacts) + showSuccessfulRestoreRelay.accept(()) + } catch { + showRestoreErrorRelay.accept(()) + } } func blockchainName(blockchainUid: String) -> String? { diff --git a/UnstoppableWallet/UnstoppableWallet/de.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/de.lproj/Localizable.strings index e3ef3b8759..db0c1413f6 100644 --- a/UnstoppableWallet/UnstoppableWallet/de.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/de.lproj/Localizable.strings @@ -1049,12 +1049,12 @@ "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "Adresse löschen"; +"contacts.restore.restored" = "Wiederhergestellt"; "contacts.restore.parsing_error" = "Datei hat falsche Daten!"; -"contacts.restore.storage_error" = "Kontakte können nicht gespeichert werden!"; +"contacts.restore.restore_error" = "Wiederherstellung der Kontakte fehlgeschlagen"; "contacts.restore.overwrite_alert.description" = "Diese Aktion wird Ihre lokalen Zahlungskontakte sowie die iCloud-Kopie (falls vorhanden) überschreiben."; "contacts.restore.overwrite_alert.replace" = "Ersetzen"; - "contacts.add_address.title" = "Adresse hinzufügen"; "contacts.add_address.create_new" = "Neuen Kontakt erstellen"; "contacts.add_address.add_to_contact" = "Zu vorhandenem Kontakt hinzufügen"; @@ -1516,7 +1516,7 @@ "activate_subscription.sign" = "Signieren"; "activate_subscription.activating" = "Activating..."; "activate_subscription.failed_to_activate" = "Failed to activate subscription"; - +"activate_subscription.activated" = "Activated"; // Launch diff --git a/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings index 051b210080..536e8be5fe 100644 --- a/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings @@ -1071,12 +1071,12 @@ Go to Settings - > Unstoppable and allow access to the camera."; "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "Delete Address"; +"contacts.restore.restored" = "Restored"; "contacts.restore.parsing_error" = "File has wrong data!"; -"contacts.restore.storage_error" = "Can't save contacts!"; +"contacts.restore.restore_error" = "Failed to restore contacts"; "contacts.restore.overwrite_alert.description" = "This action will overwrite your local payment contacts as well as its iCloud copy (if there is one)."; "contacts.restore.overwrite_alert.replace" = "Replace"; - "contacts.add_address.title" = "Add Address"; "contacts.add_address.create_new" = "Create New Contact"; "contacts.add_address.add_to_contact" = "Add to Existing Contact"; @@ -1538,7 +1538,7 @@ Go to Settings - > Unstoppable and allow access to the camera."; "activate_subscription.sign" = "Sign"; "activate_subscription.activating" = "Activating..."; "activate_subscription.failed_to_activate" = "Failed to activate subscription"; - +"activate_subscription.activated" = "Activated"; // Launch diff --git a/UnstoppableWallet/UnstoppableWallet/es.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/es.lproj/Localizable.strings index 4b1f193cc5..1bb7b3a63e 100644 --- a/UnstoppableWallet/UnstoppableWallet/es.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/es.lproj/Localizable.strings @@ -1048,12 +1048,12 @@ "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "Eliminar dirección"; +"contacts.restore.restored" = "Restaurado"; "contacts.restore.parsing_error" = "¡El archivo tiene datos incorrectos!"; -"contacts.restore.storage_error" = "¡No se pueden guardar contactos!"; +"contacts.restore.restore_error" = "Error al restaurar contactos"; "contacts.restore.overwrite_alert.description" = "Esta acción sobrescribirá sus contactos de pago locales, así como su copia de iCloud (si hay una)."; "contacts.restore.overwrite_alert.replace" = "Reemplazar"; - "contacts.add_address.title" = "Añadir dirección"; "contacts.add_address.create_new" = "Crear nuevo contacto"; "contacts.add_address.add_to_contact" = "Añadir al contacto existente"; @@ -1515,7 +1515,7 @@ "activate_subscription.sign" = "Firma"; "activate_subscription.activating" = "Activando..."; "activate_subscription.failed_to_activate" = "Error al activar la suscripción"; - +"activate_subscription.activated" = "Activado"; // Launch diff --git a/UnstoppableWallet/UnstoppableWallet/fr.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/fr.lproj/Localizable.strings index 5babef5a31..12159ca0b2 100644 --- a/UnstoppableWallet/UnstoppableWallet/fr.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/fr.lproj/Localizable.strings @@ -1048,12 +1048,12 @@ "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "Supprimer l'adresse"; +"contacts.restore.restored" = "Restauré"; "contacts.restore.parsing_error" = "Le fichier contient des données incorrectes !"; -"contacts.restore.storage_error" = "Impossible d'enregistrer les contacts !"; +"contacts.restore.restore_error" = "Impossible de restaurer les contacts"; "contacts.restore.overwrite_alert.description" = "Cette action écrasera vos contacts de paiement locaux ainsi que la copie iCloud (s'il y en a une)."; "contacts.restore.overwrite_alert.replace" = "Remplacer"; - "contacts.add_address.title" = "Ajouter une adresse"; "contacts.add_address.create_new" = "Créer un nouveau contact"; "contacts.add_address.add_to_contact" = "Ajouter au contact existant"; @@ -1516,7 +1516,7 @@ "activate_subscription.sign" = "Signer"; "activate_subscription.activating" = "Activation..."; "activate_subscription.failed_to_activate" = "Impossible d'activer l'abonnement"; - +"activate_subscription.activated" = "Activé"; // Launch diff --git a/UnstoppableWallet/UnstoppableWallet/ko.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/ko.lproj/Localizable.strings index a0f86e41bf..7e3ce153e8 100644 --- a/UnstoppableWallet/UnstoppableWallet/ko.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/ko.lproj/Localizable.strings @@ -1048,12 +1048,12 @@ "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "주소 삭제 "; +"contacts.restore.restored" = "복원됨"; "contacts.restore.parsing_error" = "파일에 잘못된 데이터가 있습니다!"; -"contacts.restore.storage_error" = "연락처를 저장할 수 없습니다!"; +"contacts.restore.restore_error" = "연락처 복원에 실패했습니다"; "contacts.restore.overwrite_alert.description" = "이 작업은 로컬 결제 연락처와 iCloud 복사본(있는 경우)을 덮어씁니다."; "contacts.restore.overwrite_alert.replace" = "위젯 변경"; - "contacts.add_address.title" = "주소 추가"; "contacts.add_address.create_new" = "새 연락처 등록"; "contacts.add_address.add_to_contact" = "기존 연락처에 추가"; @@ -1515,7 +1515,7 @@ "activate_subscription.sign" = "가입"; "activate_subscription.activating" = "Activating..."; "activate_subscription.failed_to_activate" = "Failed to activate subscription"; - +"activate_subscription.activated" = "Activated"; // Launch diff --git a/UnstoppableWallet/UnstoppableWallet/pt.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/pt.lproj/Localizable.strings index a1be2c8b84..a94fc7858b 100644 --- a/UnstoppableWallet/UnstoppableWallet/pt.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/pt.lproj/Localizable.strings @@ -1050,12 +1050,12 @@ Vá para Configurações → \"Unstoppable\" e permita o acesso à câmera."; "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "Excluir endereço"; +"contacts.restore.restored" = "Restaurado"; "contacts.restore.parsing_error" = "O arquivo tem dados errados!"; -"contacts.restore.storage_error" = "Não é possível salvar os contatos!"; +"contacts.restore.restore_error" = "Erro ao restaurar contatos"; "contacts.restore.overwrite_alert.description" = "Esta ação substituirá seus contatos de pagamento locais, bem como sua cópia do iCloud (se houver uma)."; "contacts.restore.overwrite_alert.replace" = "Substituir"; - "contacts.add_address.title" = "Adicionar endereço"; "contacts.add_address.create_new" = "Criar Novo Contato"; "contacts.add_address.add_to_contact" = "Adicionar ao Contato Existente"; @@ -1517,7 +1517,7 @@ Vá para Configurações → \"Unstoppable\" e permita o acesso à câmera."; "activate_subscription.sign" = "Assinar"; "activate_subscription.activating" = "Ativando..."; "activate_subscription.failed_to_activate" = "Falha ao ativar a assinatura"; - +"activate_subscription.activated" = "Ativado"; // Launch diff --git a/UnstoppableWallet/UnstoppableWallet/ru.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/ru.lproj/Localizable.strings index 24b42a848c..05a7728b5d 100644 --- a/UnstoppableWallet/UnstoppableWallet/ru.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/ru.lproj/Localizable.strings @@ -1052,12 +1052,12 @@ "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "Удалить адрес"; +"contacts.restore.restored" = "Восстановлено"; "contacts.restore.parsing_error" = "Файл имеет неправильные данные!"; -"contacts.restore.storage_error" = "Не удается сохранить контакты!"; +"contacts.restore.restore_error" = "Не удалось восстановить контакты"; "contacts.restore.overwrite_alert.description" = "Это действие перезапишет ваши локальные платежные контакты, а также их копии в iCloud (при наличии таковых)."; "contacts.restore.overwrite_alert.replace" = "Заменить"; - "contacts.add_address.title" = "Добавить адрес"; "contacts.add_address.create_new" = "Создать новый контакт"; "contacts.add_address.add_to_contact" = "Добавить в существующий контакт"; @@ -1521,7 +1521,7 @@ "activate_subscription.sign" = "Подписать"; "activate_subscription.activating" = "Активация..."; "activate_subscription.failed_to_activate" = "Не удалось активировать подписку"; - +"activate_subscription.activated" = "Активировано"; // Launch diff --git a/UnstoppableWallet/UnstoppableWallet/tr.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/tr.lproj/Localizable.strings index e39f9a3c80..4c6e2e12e8 100644 --- a/UnstoppableWallet/UnstoppableWallet/tr.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/tr.lproj/Localizable.strings @@ -1050,12 +1050,12 @@ Ayarlar - > Unstoppable ekranına giderek kamera erişimine izin verin."; "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "Adresi Sil"; +"contacts.restore.restored" = "Restored"; "contacts.restore.parsing_error" = "Dosyada yanlış veriler var!"; -"contacts.restore.storage_error" = "Kişiler kaydedilemiyor!"; +"contacts.restore.restore_error" = "Failed to restore contacts "; "contacts.restore.overwrite_alert.description" = "Bu işlem, cihazdaki ödeme kişilerinizin yanı sıra iCloud kopyasının (varsa) üzerine yazacaktır."; "contacts.restore.overwrite_alert.replace" = "Değiştir"; - "contacts.add_address.title" = "Adres ekle"; "contacts.add_address.create_new" = "Yeni Kişi Oluştur"; "contacts.add_address.add_to_contact" = "Mevcut Kişiye Ekle"; @@ -1517,7 +1517,7 @@ Ayarlar - > Unstoppable ekranına giderek kamera erişimine izin verin."; "activate_subscription.sign" = "kaydol"; "activate_subscription.activating" = "Activating..."; "activate_subscription.failed_to_activate" = "Failed to activate subscription"; - +"activate_subscription.activated" = "Activated"; // Launch diff --git a/UnstoppableWallet/UnstoppableWallet/zh.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/zh.lproj/Localizable.strings index d156df2266..f23f33fe4b 100644 --- a/UnstoppableWallet/UnstoppableWallet/zh.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/zh.lproj/Localizable.strings @@ -1051,12 +1051,12 @@ "contacts.contact.address.blockchain" = "Blockchain"; "contacts.contact.address.delete_address" = "删除地址"; +"contacts.restore.restored" = "恢复"; "contacts.restore.parsing_error" = "文件包含错误数据!"; -"contacts.restore.storage_error" = "无法保存联系人!"; +"contacts.restore.restore_error" = "无法恢复联系人"; "contacts.restore.overwrite_alert.description" = "此操作将覆盖您的本地付款联系人以及它的 iCloud 副本(如有)。"; "contacts.restore.overwrite_alert.replace" = "替换"; - "contacts.add_address.title" = "添加地址"; "contacts.add_address.create_new" = "创建新联系人"; "contacts.add_address.add_to_contact" = "添加到现有联系人"; @@ -1518,7 +1518,7 @@ "activate_subscription.sign" = "签名"; "activate_subscription.activating" = "激活"; "activate_subscription.failed_to_activate" = "订阅激活失败"; - +"activate_subscription.activated" = "已激活"; // Launch