Launcher/src/renderer/redux/reducers/viewReducer.ts
Daniel Scalzi dc00e6104b
Initial work on distro load logic.
Added new FATAL view to display information when a distro load fails. This replaces
the overlay behavior used on v1. The fatal view will eventually do an update check
and allow the user to update the app. This solves a potential issue of a user using
a very outdated launcher version, and the distro failing as a result.

Added new wrapper classes to store the distribution in the redux store.
2020-08-29 01:12:39 -04:00

15 lines
418 B
TypeScript

import { Reducer } from 'redux'
import { View } from '../../meta/Views'
import { ChangeViewAction, ViewActionType } from '../actions/viewActions'
const defaultView = View.NONE
const ViewReducer: Reducer<View, ChangeViewAction> = (state = defaultView, action) => {
switch(action.type) {
case ViewActionType.ChangeView:
return action.payload
}
return state
}
export default ViewReducer