-
Notifications
You must be signed in to change notification settings - Fork 36
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
Conversation
@@ -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? |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Слегка обновил на актуальный подход
func scanCard(completion: @escaping (Result<AppScanTaskResponse, TangemSdkError>) -> Void) | ||
func scanCardPublisher() -> AnyPublisher<AppScanTaskResponse, TangemSdkError> | ||
} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для более быстрого скана в детеилс
обновил тэг |
Рефакторинг последней части по работе с картами - сканнера.