Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-5193 Refactor scanning #3134

Merged
merged 3 commits into from
Apr 16, 2024
Merged

IOS-5193 Refactor scanning #3134

merged 3 commits into from
Apr 16, 2024

Conversation

tureck1y
Copy link
Collaborator

@tureck1y tureck1y commented Apr 12, 2024

Рефакторинг последней части по работе с картами - сканнера.

Podfile Outdated Show resolved Hide resolved
@@ -12,7 +12,7 @@ import TangemSdk
struct OnboardingInput { // TODO: Split to coordinator options and input
let backupService: BackupService
let primaryCardId: String
let cardInitializer: CardInitializable?
let cardInitializer: CardInitializer?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут и далее переименование для соответствия сканнеру. Придумать красивое название для соответствиям остальным интеракторам не получилось

@@ -83,7 +81,26 @@ class CommonUserWalletRepository: UserWalletRepository {
}

private func scanPublisher() -> AnyPublisher<UserWalletRepositoryResult?, Never> {
scanInternal()
var config = TangemSdkConfigFactory().makeDefaultConfig()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Временный перенос, в задаче с Моками сканер вообще вынесу отсюда https://tangem.atlassian.net/browse/IOS-6570

import Foundation
import TangemSdk

protocol CardInitializer {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

переименовал и вынес отдельно

@@ -76,6 +65,9 @@ extension CardInitializer: CardInitializable {
case .failure(let error):
completion(.failure(error))
}

withExtendedLifetime(task) {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Слегка обновил на актуальный подход

Comment on lines +19 to +21
func scanCard(completion: @escaping (Result<AppScanTaskResponse, TangemSdkError>) -> Void)
func scanCardPublisher() -> AnyPublisher<AppScanTaskResponse, TangemSdkError>
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пока два метода, возможно в задаче с Моками оставлю один

performDerivations: parameters.performDerivations
)

let didBecomeActivePublisher = NotificationCenter.didBecomeActivePublisher
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для сканнера тоже актуально, чтобы анимации норм играли

@@ -43,12 +43,17 @@ struct AppScanTaskResponse {
final class AppScanTask: CardSessionRunnable {
let shouldAskForAccessCode: Bool

private let performDerivations: Bool
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для более быстрого скана в детеилс

@tureck1y tureck1y marked this pull request as ready for review April 12, 2024 16:15
@tureck1y tureck1y requested a review from a team as a code owner April 12, 2024 16:15
Andoran90
Andoran90 previously approved these changes Apr 15, 2024
@tureck1y
Copy link
Collaborator Author

обновил тэг

@tureck1y tureck1y enabled auto-merge April 15, 2024 16:18
@tureck1y tureck1y disabled auto-merge April 16, 2024 10:47
@tureck1y tureck1y merged commit 3f5e7c9 into develop Apr 16, 2024
2 of 3 checks passed
@tureck1y tureck1y deleted the IOS-5193_refactor_scanner branch April 16, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants