mirror of
https://github.com/zoriya/flood.git
synced 2025-12-21 14:45:14 +00:00
Add torrent details data
This commit is contained in:
@@ -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(
|
||||
{},
|
||||
|
||||
Reference in New Issue
Block a user