add auto open security
This commit is contained in:
		
							parent
							
								
									107318ef21
								
							
						
					
					
						commit
						b466864350
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -182,6 +182,9 @@ struct SettingsView: View {
 | 
			
		||||
private extension SettingsView {
 | 
			
		||||
    func handleTwoFactorOnboardingIfNeeded() {
 | 
			
		||||
        guard viewModel.onboardingDestination == .securitySettings else { return }
 | 
			
		||||
        guard !isSecurityActive else { return }
 | 
			
		||||
        DispatchQueue.main.async {
 | 
			
		||||
            isSecurityActive = true
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user