Display list column (#5750)
This commit is contained in:
parent
269a445c0b
commit
31ac5f0e00
10 changed files with 166 additions and 1 deletions
|
@ -22,6 +22,7 @@ import media_attachments from './media_attachments';
|
|||
import notifications from './notifications';
|
||||
import height_cache from './height_cache';
|
||||
import custom_emojis from './custom_emojis';
|
||||
import lists from './lists';
|
||||
|
||||
const reducers = {
|
||||
timelines,
|
||||
|
@ -47,6 +48,7 @@ const reducers = {
|
|||
notifications,
|
||||
height_cache,
|
||||
custom_emojis,
|
||||
lists,
|
||||
};
|
||||
|
||||
export default combineReducers(reducers);
|
||||
|
|
15
app/javascript/mastodon/reducers/lists.js
Normal file
15
app/javascript/mastodon/reducers/lists.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { LIST_FETCH_SUCCESS } from '../actions/lists';
|
||||
import { Map as ImmutableMap, fromJS } from 'immutable';
|
||||
|
||||
const initialState = ImmutableMap();
|
||||
|
||||
const normalizeList = (state, list) => state.set(list.id, fromJS(list));
|
||||
|
||||
export default function lists(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case LIST_FETCH_SUCCESS:
|
||||
return normalizeList(state, action.list);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue