Skip to content

Commit

Permalink
IOS-2393 Use correct type of code in the reset message
Browse files Browse the repository at this point in the history
  • Loading branch information
megakoko committed Oct 31, 2022
1 parent d148684 commit 661a03c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"attestation_online_failed_title" = "Online attestation failed";
"attestation_online_failed_body" = "We cannot finish card's online attestation at this time. You can continue at your own risk and try again later, retry now or cancel the operation";
"attestation_warning_attest_wallets" = "Too many runs of Attest Wallet or Sign looks suspicious.";
"reset_codes_scan_first_card" = "Scan the card on which you want to reset the pin";
"reset_codes_scan_first_card" = "Scan the card on which you want to reset the %@";
"reset_codes_scan_confirmation_card" = "Scan another linked card";
"reset_codes_scan_to_reset" = "Scan card to reset user codes";
"reset_codes_message_title_restore" = "Tap the card you want to restore";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"attestation_online_failed_title" = "Online attestation failed";
"attestation_online_failed_body" = "We cannot finish card's online attestation at this time. You can continue at your own risk and try again later, retry now or cancel the operation";
"attestation_warning_attest_wallets" = "Too many runs of Attest Wallet or Sign looks suspicious.";
"reset_codes_scan_first_card" = "Scan the card on which you want to reset the pin";
"reset_codes_scan_first_card" = "Scan the card on which you want to reset the %@";
"reset_codes_scan_confirmation_card" = "Scan another linked card";
"reset_codes_scan_to_reset" = "Scan card to reset user codes";
"reset_codes_message_title_restore" = "Tap the card you want to restore";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"attestation_online_failed_title" = "Online attestation failed";
"attestation_online_failed_body" = "We cannot finish card's online attestation at this time. You can continue at your own risk and try again later, retry now or cancel the operation";
"attestation_warning_attest_wallets" = "Too many runs of Attest Wallet or Sign looks suspicious.";
"reset_codes_scan_first_card" = "Scan the card on which you want to reset the pin";
"reset_codes_scan_first_card" = "Scan the card on which you want to reset the %@";
"reset_codes_scan_confirmation_card" = "Scan another linked card";
"reset_codes_scan_to_reset" = "Scan card to reset user codes";
"reset_codes_message_title_restore" = "Tap the card you want to restore";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"attestation_online_failed_title" = "Online attestation failed";
"attestation_online_failed_body" = "We cannot finish card's online attestation at this time. You can continue at your own risk and try again later, retry now or cancel the operation";
"attestation_warning_attest_wallets" = "Too many runs of Attest Wallet or Sign looks suspicious.";
"reset_codes_scan_first_card" = "Scan the card on which you want to reset the pin";
"reset_codes_scan_first_card" = "Scan the card on which you want to reset the %@";
"reset_codes_scan_confirmation_card" = "Scan another linked card";
"reset_codes_scan_to_reset" = "Scan card to reset user codes";
"reset_codes_message_title_restore" = "Tap the card you want to restore";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"attestation_online_failed_title" = "Онлайн-аттестация не удалась";
"attestation_online_failed_body" = "В настоящее время мы не можем завершить онлайн-аттестацию карты. Вы можете продолжить на свой страх и риск и повторить попытку позже, повторить сейчас или отменить операцию.";
"attestation_warning_attest_wallets" = "Слишком большое количество вызовов Attest Wallet или Sign выглядит подозрительно.";
"reset_codes_scan_first_card" = "Отсканируйте карту, на которой вы хотите сбросить пин-код";
"reset_codes_scan_first_card" = "Отсканируйте карту, на которой вы хотите сбросить %@";
"reset_codes_scan_confirmation_card" = "Отсканируйте другую привязанную карту";
"reset_codes_scan_to_reset" = "Отсканируйте карту для сброса кода";
"reset_codes_message_title_restore" = "Отсканируйте карту, которую хотите восстановить";
Expand Down
11 changes: 10 additions & 1 deletion TangemSdk/TangemSdk/Operations/ResetCode/ResetPinService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,18 @@ public class ResetPinService: ObservableObject {
}

private func scanResetPinCard(resetCardId: String?, _ completion: @escaping CompletionResult<Void>) {
let userCodeType: UserCodeType
if repo.accessCode != nil {
userCodeType = .accessCode
} else if repo.passcode != nil {
userCodeType = .passcode
} else {
fatalError("Scan card called without the code specified")
}

self.session = TangemSdk().makeSession(with: config,
cardId: resetCardId,
initialMessage: Message(header: "reset_codes_scan_first_card".localized))
initialMessage: Message(header: "reset_codes_scan_first_card".localized([userCodeType.name.lowercased()])))

session!.start(with: GetResetPinTokenCommand()) { result in
switch result {
Expand Down

0 comments on commit 661a03c

Please sign in to comment.