Closes #258 this checks that when the user taps the finished button on the phrase displayed it has definitely not passed the test before going to the recovery flow. Note: this should actually go to the next or previous screen according to the context. That should be taken into consideration when implementing the profile screen that takes the user to the phrase diplay screen from that context. Add //TODO comment with the permanent fix for the problem
This commit is contained in:
parent
96511e0e36
commit
c832d2822c
|
@ -250,7 +250,7 @@ extension AppReducer {
|
|||
}
|
||||
}
|
||||
|
||||
private static let routeReducer = AppReducer { state, action, _ in
|
||||
private static let routeReducer = AppReducer { state, action, environment in
|
||||
switch action {
|
||||
case let .updateRoute(route):
|
||||
state.route = route
|
||||
|
@ -269,7 +269,14 @@ extension AppReducer {
|
|||
state.route = .phraseDisplay
|
||||
|
||||
case .phraseDisplay(.finishedPressed):
|
||||
state.route = .phraseValidation
|
||||
//TODO: Advanced Routing: setting a route may vary depending on the originating context #285
|
||||
// see https://github.com/zcash/secant-ios-wallet/issues/285
|
||||
if let storedWallet = try? environment.walletStorage.exportWallet(),
|
||||
storedWallet.hasUserPassedPhraseBackupTest {
|
||||
state.route = .home
|
||||
} else {
|
||||
state.route = .phraseValidation
|
||||
}
|
||||
|
||||
/// Default is meaningful here because there's `appReducer` handling actions and this reducer is handling only routes. We don't here plenty of unused cases.
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue