mirror of
https://github.com/zoriya/flood.git
synced 2026-05-28 09:27:35 +00:00
Add modal to state
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user