about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers/relationships.jsx
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-03 16:57:44 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-03 16:57:44 +0100
commit3731230c6d25f248afa8a17b62b3db70fdfe1e03 (patch)
tree9e7da1198a5e20c600add1cad4c0c288c524d1f9 /app/assets/javascripts/components/reducers/relationships.jsx
parente4671adc25081161268c885b3427fd84cbecb249 (diff)
Allow @username@domain/@username in follow form, prevent duplicate accounts
created via remote look-up when domains differ but point to the same resource
Diffstat (limited to 'app/assets/javascripts/components/reducers/relationships.jsx')
-rw-r--r--app/assets/javascripts/components/reducers/relationships.jsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/components/reducers/relationships.jsx b/app/assets/javascripts/components/reducers/relationships.jsx
index 165b1f3ff..e4af1f028 100644
--- a/app/assets/javascripts/components/reducers/relationships.jsx
+++ b/app/assets/javascripts/components/reducers/relationships.jsx
@@ -7,7 +7,7 @@ import {
 } from '../actions/accounts';
 import Immutable from 'immutable';
 
-const normalizeRelationship = (state, relationship) => state.set(relationship.get('id'), relationship);
+const normalizeRelationship = (state, relationship) => state.set(relationship.id, Immutable.fromJS(relationship));
 
 const normalizeRelationships = (state, relationships) => {
   relationships.forEach(relationship => {
@@ -25,9 +25,9 @@ export default function relationships(state = initialState, action) {
     case ACCOUNT_UNFOLLOW_SUCCESS:
     case ACCOUNT_BLOCK_SUCCESS:
     case ACCOUNT_UNBLOCK_SUCCESS:
-      return normalizeRelationship(state, Immutable.fromJS(action.relationship));
+      return normalizeRelationship(state, action.relationship);
     case RELATIONSHIPS_FETCH_SUCCESS:
-      return normalizeRelationships(state, Immutable.fromJS(action.relationships));
+      return normalizeRelationships(state, action.relationships);
     default:
       return state;
   }