diff --git a/yobble/Views/Tab/Settings/SecuritySettingsView.swift b/yobble/Views/Tab/Settings/SecuritySettingsView.swift index 2cce035..6580d3a 100644 --- a/yobble/Views/Tab/Settings/SecuritySettingsView.swift +++ b/yobble/Views/Tab/Settings/SecuritySettingsView.swift @@ -46,17 +46,23 @@ struct SecuritySettingsView: View { .listStyle(.insetGrouped) .navigationTitle(NSLocalizedString("Безопасность", comment: "Заголовок экрана настроек безопасности")) .navigationBarTitleDisplayMode(.inline) - .onAppear { handleSecuritySettingsOnboardingIfNeeded() } - .onChange(of: viewModel.onboardingDestination) { _ in - handleSecuritySettingsOnboardingIfNeeded() - } +// .onAppear { handleSecuritySettingsOnboardingIfNeeded() } +// .onChange(of: viewModel.onboardingDestination) { _ in +// handleSecuritySettingsOnboardingIfNeeded() +// } } - private func handleSecuritySettingsOnboardingIfNeeded() { - guard viewModel.onboardingDestination == .securitySettings else { return } -// isSecuritySettingsActive = true - viewModel.onboardingDestination = nil - } +// private func handleSecuritySettingsOnboardingIfNeeded() { +// guard viewModel.onboardingDestination == .securitySettings else { return } +// guard !isTwoFactorActive else { +// viewModel.onboardingDestination = nil +// return +// } +// DispatchQueue.main.async { +// isTwoFactorActive = true +// viewModel.onboardingDestination = nil +// } +// } } #if DEBUG diff --git a/yobble/Views/Tab/Settings/SettingsView.swift b/yobble/Views/Tab/Settings/SettingsView.swift index 476fecc..cdc4860 100644 --- a/yobble/Views/Tab/Settings/SettingsView.swift +++ b/yobble/Views/Tab/Settings/SettingsView.swift @@ -182,6 +182,9 @@ struct SettingsView: View { private extension SettingsView { func handleTwoFactorOnboardingIfNeeded() { guard viewModel.onboardingDestination == .securitySettings else { return } - isSecurityActive = true + guard !isSecurityActive else { return } + DispatchQueue.main.async { + isSecurityActive = true + } } }