patch login
This commit is contained in:
parent
0311e0f5b1
commit
0a162a5b2d
@ -1835,9 +1835,6 @@
|
||||
},
|
||||
"Подтвердить" : {
|
||||
"comment" : "Кнопка подтверждения кода 2FA"
|
||||
},
|
||||
"Подтвердить вход" : {
|
||||
|
||||
},
|
||||
"Подтверждение email" : {
|
||||
"comment" : "Раздел подтверждения email"
|
||||
@ -2133,6 +2130,9 @@
|
||||
},
|
||||
"Проверьте цифры и попробуйте снова." : {
|
||||
"comment" : "Описание ошибки неверного кода 2FA"
|
||||
},
|
||||
"Проверяем код…" : {
|
||||
|
||||
},
|
||||
"Продолжить" : {
|
||||
|
||||
|
||||
@ -539,26 +539,16 @@ private struct PasswordlessVerifyView: View {
|
||||
|
||||
OTPInputView(code: $viewModel.verificationCode, isFocused: $isCodeFieldFocused)
|
||||
|
||||
// Button {
|
||||
// withAnimation {
|
||||
// viewModel.verifyPasswordlessCode()
|
||||
// }
|
||||
// } label: {
|
||||
// if viewModel.isVerifyingCode {
|
||||
// ProgressView()
|
||||
// .frame(maxWidth: .infinity)
|
||||
// .padding()
|
||||
// } else {
|
||||
// Text(NSLocalizedString("Подтвердить вход", comment: ""))
|
||||
// .bold()
|
||||
// .frame(maxWidth: .infinity)
|
||||
// .padding()
|
||||
// }
|
||||
// }
|
||||
// .foregroundColor(.white)
|
||||
// .background(viewModel.canVerifyPasswordlessCode ? Color.blue : Color.gray)
|
||||
// .cornerRadius(12)
|
||||
// .disabled(!viewModel.canVerifyPasswordlessCode)
|
||||
if viewModel.isVerifyingCode {
|
||||
HStack(spacing: 8) {
|
||||
ProgressView()
|
||||
Text(NSLocalizedString("Проверяем код…", comment: ""))
|
||||
.font(.subheadline)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 4)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text(NSLocalizedString("Не получили код?", comment: ""))
|
||||
@ -619,6 +609,12 @@ private struct PasswordlessVerifyView: View {
|
||||
isCodeFieldFocused = false
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
triggerAutoVerificationIfNeeded()
|
||||
}
|
||||
.onChange(of: viewModel.verificationCode) { _ in
|
||||
triggerAutoVerificationIfNeeded()
|
||||
}
|
||||
.loginErrorAlert(viewModel: viewModel)
|
||||
}
|
||||
|
||||
@ -640,6 +636,11 @@ private struct PasswordlessVerifyView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func triggerAutoVerificationIfNeeded() {
|
||||
guard viewModel.canVerifyPasswordlessCode else { return }
|
||||
viewModel.verifyPasswordlessCode()
|
||||
}
|
||||
}
|
||||
|
||||
private struct OTPInputView: View {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user