Prevent crashes when tapping multiple space children in the spaces tab
Also introduce logs for SpaceFlowCoordinator state machine transitions
This commit is contained in:
committed by
Stefan Ceriu
parent
8271060261
commit
0b994002cc
@@ -244,6 +244,16 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
|
||||
selectedSpaceRoomSubject.send(nil)
|
||||
}
|
||||
|
||||
stateMachine.addRouteMapping { event, fromState, _ in
|
||||
guard case .startRoomFlow = event, case .roomFlow = fromState else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return fromState
|
||||
} handler: { _ in
|
||||
// Ignore tapping on multiple rooms at the same time
|
||||
}
|
||||
|
||||
stateMachine.addRouteMapping { event, fromState, _ in
|
||||
guard case .startRoomFlow = event, case .space = fromState else { return nil }
|
||||
return .roomFlow(previousState: fromState)
|
||||
@@ -331,6 +341,14 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
|
||||
stateMachine.addErrorHandler { context in
|
||||
fatalError("Unexpected transition: \(context)")
|
||||
}
|
||||
|
||||
stateMachine.addAnyHandler(.any => .any) { context in
|
||||
if let event = context.event {
|
||||
MXLog.info("Transitioning from `\(context.fromState)` to `\(context.toState)` with event `\(event)`")
|
||||
} else {
|
||||
MXLog.info("Transitioning from \(context.fromState)` to `\(context.toState)`")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func presentSpace() {
|
||||
|
||||
Reference in New Issue
Block a user