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 {
|
switch action {
|
||||||
case let .updateRoute(route):
|
case let .updateRoute(route):
|
||||||
state.route = route
|
state.route = route
|
||||||
|
case .home(.reset):
|
||||||
|
state.route = .startup
|
||||||
case .onboarding(.createNewWallet):
|
case .onboarding(.createNewWallet):
|
||||||
state.route = .home
|
state.route = .home
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -19,6 +19,7 @@ enum HomeAction: Equatable {
|
||||||
case updateRoute(HomeState.Route?)
|
case updateRoute(HomeState.Route?)
|
||||||
case transactionHistory(TransactionHistoryAction)
|
case transactionHistory(TransactionHistoryAction)
|
||||||
case profile(ProfileAction)
|
case profile(ProfileAction)
|
||||||
|
case reset
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - HomeReducer
|
// MARK: - HomeReducer
|
||||||
|
@ -46,6 +47,8 @@ extension HomeReducer {
|
||||||
return ProfileEnvironment()
|
return ProfileEnvironment()
|
||||||
})
|
})
|
||||||
.run(&state, action, ())
|
.run(&state, action, ())
|
||||||
|
case .reset:
|
||||||
|
return .none
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,11 @@ struct HomeView: View {
|
||||||
action: { viewStore.toggleSelectedTransaction() },
|
action: { viewStore.toggleSelectedTransaction() },
|
||||||
label: { Text("Toggle Selected Transaction") }
|
label: { Text("Toggle Selected Transaction") }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Button(
|
||||||
|
action: { viewStore.send(.reset) },
|
||||||
|
label: { Text("Reset (to startup)") }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue