Add `.reset` action to `Home`
This is here for convenience while we are in the "placeholder" stages, to give a way to navigate to the "App" screen from Home
This commit is contained in:
parent
c035bed146
commit
8ec6494044
|
@ -37,6 +37,8 @@ extension AppReducer {
|
|||
switch action {
|
||||
case let .updateRoute(route):
|
||||
state.route = route
|
||||
case .home(.reset):
|
||||
state.route = .startup
|
||||
case .onboarding(.createNewWallet):
|
||||
state.route = .home
|
||||
default:
|
||||
|
|
|
@ -19,6 +19,7 @@ enum HomeAction: Equatable {
|
|||
case updateRoute(HomeState.Route?)
|
||||
case transactionHistory(TransactionHistoryAction)
|
||||
case profile(ProfileAction)
|
||||
case reset
|
||||
}
|
||||
|
||||
// MARK: - HomeReducer
|
||||
|
@ -46,6 +47,8 @@ extension HomeReducer {
|
|||
return ProfileEnvironment()
|
||||
})
|
||||
.run(&state, action, ())
|
||||
case .reset:
|
||||
return .none
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,11 @@ struct HomeView: View {
|
|||
action: { viewStore.toggleSelectedTransaction() },
|
||||
label: { Text("Toggle Selected Transaction") }
|
||||
)
|
||||
|
||||
Button(
|
||||
action: { viewStore.send(.reset) },
|
||||
label: { Text("Reset (to startup)") }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue