revision history ui
This commit is contained in:
@@ -37,6 +37,7 @@ import group_relationships from './group_relationships';
|
||||
import group_lists from './group_lists';
|
||||
import group_editor from './group_editor';
|
||||
import sidebar from './sidebar';
|
||||
import status_revision_list from './status_revision_list';
|
||||
|
||||
const reducers = {
|
||||
dropdown_menu,
|
||||
@@ -77,6 +78,7 @@ const reducers = {
|
||||
group_lists,
|
||||
group_editor,
|
||||
sidebar,
|
||||
status_revision_list,
|
||||
};
|
||||
|
||||
export default combineReducers(reducers);
|
||||
|
||||
31
app/javascript/gabsocial/reducers/status_revision_list.js
Normal file
31
app/javascript/gabsocial/reducers/status_revision_list.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Map as ImmutableMap } from 'immutable';
|
||||
import {
|
||||
STATUS_REVISION_LIST_LOAD,
|
||||
STATUS_REVISION_LIST_LOAD_SUCCESS,
|
||||
STATUS_REVISION_LIST_LOAD_FAIL
|
||||
} from '../actions/status_revision_list';
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
loading: false,
|
||||
error: null,
|
||||
data: null
|
||||
});
|
||||
|
||||
export default function statusRevisionList(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case STATUS_REVISION_LIST_LOAD:
|
||||
return initialState;
|
||||
case STATUS_REVISION_LIST_LOAD_SUCCESS:
|
||||
return state.withMutations(mutable => {
|
||||
mutable.set('loading', false);
|
||||
mutable.set('data', action.payload);
|
||||
});
|
||||
case STATUS_REVISION_LIST_LOAD_FAIL:
|
||||
return state.withMutations(mutable => {
|
||||
mutable.set('loading', false);
|
||||
mutable.set('error', action.payload);
|
||||
});
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user