diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-13 02:24:40 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-13 02:24:40 +0200 |
commit | 2e7aac793ace0e938e45cb54ff601afa5d872214 (patch) | |
tree | 5c45c25a21ef9b1068604b8c459e1855ba91f239 /app/assets/javascripts/components/reducers | |
parent | d6a64f45fd4530cfee4f7721f0c6e7ca28fe677f (diff) |
Adding sense of self to the UI, cleaning up routing, adding third (detail) column
Diffstat (limited to 'app/assets/javascripts/components/reducers')
-rw-r--r-- | app/assets/javascripts/components/reducers/timelines.jsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/reducers/timelines.jsx b/app/assets/javascripts/components/reducers/timelines.jsx index b6ecdfb1f..24adeccf8 100644 --- a/app/assets/javascripts/components/reducers/timelines.jsx +++ b/app/assets/javascripts/components/reducers/timelines.jsx @@ -1,12 +1,14 @@ import { TIMELINE_SET, TIMELINE_UPDATE, TIMELINE_DELETE } from '../actions/timelines'; import { REBLOG_SUCCESS, FAVOURITE_SUCCESS } from '../actions/interactions'; +import { ACCOUNT_SET_SELF } from '../actions/accounts'; import Immutable from 'immutable'; const initialState = Immutable.Map({ home: Immutable.List([]), mentions: Immutable.List([]), statuses: Immutable.Map(), - accounts: Immutable.Map() + accounts: Immutable.Map(), + me: null }); function statusToMaps(state, status) { @@ -63,6 +65,11 @@ export default function timelines(state = initialState, action) { case REBLOG_SUCCESS: case FAVOURITE_SUCCESS: return statusToMaps(state, Immutable.fromJS(action.response)); + case ACCOUNT_SET_SELF: + return state.withMutations(map => { + map.setIn(['accounts', action.account.id], Immutable.fromJS(action.account)); + map.set('me', action.account.id); + }); default: return state; } |