From b466864350345257a9b719e2cd8770f29ef59aa1 Mon Sep 17 00:00:00 2001 From: cheykrym Date: Fri, 24 Oct 2025 11:58:09 +0300 Subject: [PATCH] add auto open security --- .../Tab/Settings/SecuritySettingsView.swift | 24 ++++++++++++------- yobble/Views/Tab/Settings/SettingsView.swift | 5 +++- 2 files changed, 19 insertions(+), 10 deletions(-) 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 + } } }