about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/selectors
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-03-29 09:26:31 -0500
committerGitHub <noreply@github.com>2018-03-29 09:26:31 -0500
commit1bd12cf8ebaebfac440bcefd241b564997272ffb (patch)
tree61889ce4f92f8aa107eb92f053f119cfdbd07ea1 /app/javascript/flavours/glitch/selectors
parent4e45954280390f90dcacc2fd0a33bf75114b38d6 (diff)
parentb5948044b31c548de15337dcdca35b4c894224c0 (diff)
Merge pull request #404 from ThibG/glitch-soc/features/moved-note
[Untested] [Glitch] Profile redirect notes
Diffstat (limited to 'app/javascript/flavours/glitch/selectors')
-rw-r--r--app/javascript/flavours/glitch/selectors/index.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/selectors/index.js b/app/javascript/flavours/glitch/selectors/index.js
index d26d1b727..e47ec5183 100644
--- a/app/javascript/flavours/glitch/selectors/index.js
+++ b/app/javascript/flavours/glitch/selectors/index.js
@@ -4,14 +4,18 @@ import { List as ImmutableList } from 'immutable';
 const getAccountBase         = (state, id) => state.getIn(['accounts', id], null);
 const getAccountCounters     = (state, id) => state.getIn(['accounts_counters', id], null);
 const getAccountRelationship = (state, id) => state.getIn(['relationships', id], null);
+const getAccountMoved        = (state, id) => state.getIn(['accounts', state.getIn(['accounts', id, 'moved'])]);
 
 export const makeGetAccount = () => {
-  return createSelector([getAccountBase, getAccountCounters, getAccountRelationship], (base, counters, relationship) => {
+  return createSelector([getAccountBase, getAccountCounters, getAccountRelationship, getAccountMoved], (base, counters, relationship, moved) => {
     if (base === null) {
       return null;
     }
 
-    return base.merge(counters).set('relationship', relationship);
+    return base.merge(counters).withMutations(map => {
+      map.set('relationship', relationship);
+      map.set('moved', moved);
+    });
   });
 };