Pleroma relationship fixes

This commit is contained in:
Alex Gleason 2020-08-02 21:45:42 -05:00
parent ccec8698fc
commit 7fe70a64b5
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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) => {