From 7fe70a64b59eb6ac8751b450ae443f64281561b4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 2 Aug 2020 21:45:42 -0500 Subject: [PATCH] Pleroma relationship fixes --- app/soapbox/reducers/relationships.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/soapbox/reducers/relationships.js b/app/soapbox/reducers/relationships.js index 8881d5925..dfc93950b 100644 --- a/app/soapbox/reducers/relationships.js +++ b/app/soapbox/reducers/relationships.js @@ -22,6 +22,7 @@ import { DOMAIN_UNBLOCK_SUCCESS, } from '../actions/domain_blocks'; import { Map as ImmutableMap, fromJS } from 'immutable'; +import { get } from 'lodash'; const normalizeRelationship = (state, relationship) => state.set(relationship.id, fromJS(relationship)); @@ -42,8 +43,10 @@ const setDomainBlocking = (state, accounts, blocking) => { }; const importPleromaAccount = (state, account) => { - if (!account.pleroma) return state; - return normalizeRelationship(state, account.pleroma.relationship); + const relationship = get(account, ['pleroma', 'relationship'], {}); + if (relationship.id && relationship !== {}) + return normalizeRelationship(state, relationship); + return state; }; const importPleromaAccounts = (state, accounts) => {