Add torrent details data

This commit is contained in:
John Furrow
2015-11-21 14:28:40 -08:00
parent 61e23bddb5
commit fd9ee03999
2 changed files with 45 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
const initialState = {
torrentDetails: {},
transfers: {
updatedAt: 0,
download: {
@@ -15,6 +16,19 @@ const initialState = {
export default function clientReducer(state = initialState, action) {
switch (action.type) {
case 'RECEIVE_TORRENT_DETAILS':
let torrentDetails = {};
torrentDetails[action.payload.hash] = action.payload.torrentDetails;
return Object.assign(
{},
state,
{
...state,
torrentDetails
}
);
case 'CLIENT_RECEIVE_TRANSFER_DATA':
return Object.assign(
{},