- refactored NPED Login & logout
This commit is contained in:
@@ -5,15 +5,26 @@ export const initialState = {
|
||||
sessionList: [],
|
||||
sessionPaused: false,
|
||||
savedSightings: [],
|
||||
npedUser: null,
|
||||
};
|
||||
|
||||
export function reducer(state: NPEDSTATE, action: NPEDACTION) {
|
||||
switch (action.type) {
|
||||
case "SESSION":
|
||||
case "SESSIONSTART":
|
||||
return {
|
||||
...state,
|
||||
sessionStarted: action.payload,
|
||||
};
|
||||
case "LOGIN":
|
||||
return {
|
||||
...state,
|
||||
npedUser: action.payload,
|
||||
};
|
||||
case "LOGOUT":
|
||||
return {
|
||||
...state,
|
||||
npedUser: action.payload,
|
||||
};
|
||||
default:
|
||||
return { ...state };
|
||||
}
|
||||
Reference in New Issue
Block a user