Skip to content

Commit

Permalink
Fix/ABW-957 Biometrics check cancelled causes blank screen (#295)
Browse files Browse the repository at this point in the history
Co-authored-by: David Roman <116723827+davdroman-rdx@users.noreply.github.com>
  • Loading branch information
nikola-milicevic and davdroman-rdx committed Feb 14, 2023
1 parent f12d1d8 commit 9637d58
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ extension CreationOfEntity.Action {
extension CreationOfEntity.Action {
public enum DelegateAction: Sendable, Equatable {
case createdEntity(Entity)
case createEntityFailed
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ public struct CreationOfEntity<Entity: EntityProtocol>: Sendable, ReducerProtoco
))))
}

case let .internal(.system(.createEntityResult(.failure(error)))):
errorQueue.schedule(error)
return .none
case .internal(.system(.createEntityResult(.failure))):
return .send(.delegate(.createEntityFailed))

case let .internal(.system(.createEntityResult(.success(entity)))):
return .run { send in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public struct CreateEntityCoordinator<
state: &state
)

case .child(.step2_creationOfEntity(.delegate(.createEntityFailed))):
state.step = .step0_nameNewEntity(.init(config: state.config))
return .none

case .child(.step3_completion(.delegate(.completed))):
return .run { send in
await send(.delegate(.completed))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ final class CreationOfEntityTests: TestCase {
let expectedErrors = Set([createNewAccountError])
await store.send(.view(.appeared))
await store.receive(.internal(.system(.createEntityResult(.failure(createNewAccountError)))))
await errorQueue.withValue { errors in
XCTAssertEqual(errors, expectedErrors)
}
await store.receive(.delegate(.createEntityFailed))
}
}

0 comments on commit 9637d58

Please sign in to comment.