Move file sharing into a separate tab
This commit is contained in:
@@ -17,15 +17,6 @@ const chatmessages = (state = [], action) =>
|
||||
return [ ...state, message ];
|
||||
}
|
||||
|
||||
case 'ADD_NEW_USER_FILE':
|
||||
{
|
||||
const { file } = action.payload;
|
||||
|
||||
const message = createNewFile(file, 'client', 'Me', undefined);
|
||||
|
||||
return [ ...state, message ];
|
||||
}
|
||||
|
||||
case 'ADD_NEW_RESPONSE_MESSAGE':
|
||||
{
|
||||
const { message } = action.payload;
|
||||
|
||||
@@ -8,16 +8,4 @@ export function createNewMessage(text, sender, name, picture)
|
||||
sender,
|
||||
picture
|
||||
};
|
||||
}
|
||||
|
||||
export function createNewFile(file, sender, name, picture)
|
||||
{
|
||||
return {
|
||||
type : 'file',
|
||||
file,
|
||||
time : Date.now(),
|
||||
name,
|
||||
sender,
|
||||
picture
|
||||
};
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import notifications from './notifications';
|
||||
import chatmessages from './chatmessages';
|
||||
import chatbehavior from './chatbehavior';
|
||||
import toolarea from './toolarea';
|
||||
import sharing from './sharing';
|
||||
|
||||
const reducers = combineReducers(
|
||||
{
|
||||
@@ -19,7 +20,8 @@ const reducers = combineReducers(
|
||||
notifications,
|
||||
chatmessages,
|
||||
chatbehavior,
|
||||
toolarea
|
||||
toolarea,
|
||||
sharing
|
||||
});
|
||||
|
||||
export default reducers;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
const sharing = (state = [], action) =>
|
||||
{
|
||||
switch (action.type)
|
||||
{
|
||||
case 'SEND_FILE':
|
||||
return [ ...state, { ...action.payload, me: true }];
|
||||
|
||||
case 'ADD_FILE':
|
||||
return [ ...state, action.payload ];
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default sharing;
|
||||
Reference in New Issue
Block a user