Uploading file with corruption.
This commit is contained in:
@@ -4,6 +4,8 @@ const INITIAL_STATE = {
|
||||
photos: [],
|
||||
uploadInProgress: false,
|
||||
uploadError: null,
|
||||
jobid: null,
|
||||
progress: {}
|
||||
};
|
||||
|
||||
const photosReducer = (state = INITIAL_STATE, action) => {
|
||||
@@ -11,9 +13,22 @@ const photosReducer = (state = INITIAL_STATE, action) => {
|
||||
case PhotosActionTypes.MEDIA_UPLOAD_START:
|
||||
return {
|
||||
...state,
|
||||
photos: action.payload,
|
||||
photos: action.payload.photos,
|
||||
jobid: action.payload.jobid,
|
||||
uploadInProgress: true,
|
||||
uploadError: null,
|
||||
progress: {}
|
||||
};
|
||||
case PhotosActionTypes.MEDIA_UPLOAD_FAILURE:
|
||||
return {
|
||||
...state,
|
||||
uploadInProgress: false,
|
||||
uploadError: action.payload,
|
||||
};
|
||||
case PhotosActionTypes.MEDIA_UPLOAD_PROGRESS_UPDATE_ONE:
|
||||
return {
|
||||
...state,
|
||||
progress: { ...state.progress, [action.payload.assetId]: { ...state.progress[action.payload.assetId], ...action.payload } }
|
||||
};
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user