Add modal to state

This commit is contained in:
John Furrow
2015-11-08 00:52:03 -08:00
parent f4da39e6a3
commit 97d5dc048b
2 changed files with 17 additions and 1 deletions
@@ -2,6 +2,7 @@ import { selectTorrents } from '../util/selectTorrents';
const initialState = {
fetchingData: true,
modal: null,
torrentList: {
count: 10,
filterBy: 'all',
@@ -66,6 +67,17 @@ export default function uiReducer(state = initialState, action) {
}
);
case 'UI_DISPLAY_MODAL':
console.log(action.payload);
return Object.assign(
{},
state,
{
...state,
modal: action.payload.modal
}
);
case 'UI_SEARCH_TORRENTS':
return Object.assign(
{},
@@ -2,6 +2,8 @@ import { createSelector } from 'reselect';
const fetchingData = state => state.ui.fetchingData;
const modal = state => state.ui.modal;
const torrentListCount = state => state.ui.torrentList.count;
const torrentListSelected = state => state.ui.torrentList.selected;
@@ -31,10 +33,12 @@ const torrentList = createSelector(
const uiSelector = createSelector(
fetchingData,
modal,
torrentList,
(fetchingData, torrentList) => {
(fetchingData, modal, torrentList) => {
return {
fetchingData,
modal,
torrentList
};
}