Skip to content

Commit fd4b169

Browse files
committed
Fix dismissal in UIKit demos.
1 parent 7e90901 commit fd4b169

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

Examples/CaseStudies/UIKitCaseStudies/LoadThenNavigate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class LazyNavigationViewController: UIViewController {
107107
override func viewDidAppear(_ animated: Bool) {
108108
super.viewDidAppear(animated)
109109

110-
if !isMovingToParent {
110+
if !isMovingToParent && store.optionalCounter != nil {
111111
store.send(.setNavigation(isActive: false))
112112
}
113113
}

Examples/CaseStudies/UIKitCaseStudies/NavigateAndLoad.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class EagerNavigationViewController: UIViewController {
100100
override func viewDidAppear(_ animated: Bool) {
101101
super.viewDidAppear(animated)
102102

103-
if !isMovingToParent {
103+
if !isMovingToParent && store.isNavigationActive {
104104
store.send(.setNavigation(isActive: false))
105105
}
106106
}

Examples/TicTacToe/tic-tac-toe/Sources/LoginUIKit/LoginViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public class LoginViewController: UIViewController {
126126
public override func viewDidAppear(_ animated: Bool) {
127127
super.viewDidAppear(animated)
128128

129-
if !isMovingToParent {
129+
if !isMovingToParent && store.twoFactor != nil {
130130
store.twoFactorDismissed()
131131
}
132132
}

Examples/TicTacToe/tic-tac-toe/Sources/TwoFactorCore/TwoFactorCore.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public struct TwoFactor: Sendable {
3333
}
3434

3535
@Dependency(\.authenticationClient) var authenticationClient
36+
@Dependency(\.dismiss) var dismiss
3637

3738
public init() {}
3839

@@ -57,6 +58,8 @@ public struct TwoFactor: Sendable {
5758
return .none
5859

5960
case .view(.submitButtonTapped):
61+
return .run { _ in await self.dismiss() }
62+
6063
state.isTwoFactorRequestInFlight = true
6164
return .run { [code = state.code, token = state.token] send in
6265
await send(

Examples/TicTacToe/tic-tac-toe/Sources/TwoFactorUIKit/TwoFactorViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public final class TwoFactorViewController: UIViewController {
6363
guard let self else { return }
6464
activityIndicator.isHidden = store.isActivityIndicatorHidden
6565
codeTextField.text = store.code
66-
loginButton.isEnabled = store.isLoginButtonEnabled
66+
//loginButton.isEnabled = store.isLoginButtonEnabled
6767

6868
if let store = store.scope(state: \.alert, action: \.alert),
6969
alertController == nil

0 commit comments

Comments
 (0)