Fix pins display in account timeline
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
6144b47349
commit
5279160df9
2 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@ const AccountTimeline: React.FC<IAccountTimeline> = ({ params, withReplies = fal
|
|||
const path = withReplies ? `${account?.id}:with_replies` : account?.id;
|
||||
const showPins = settings.account_timeline.shows.pinned && !withReplies;
|
||||
const statusIds = useAppSelector(state => getStatusIds(state, { type: `account:${path}`, prefix: 'account_timeline' }));
|
||||
const featuredStatusIds = useAppSelector(state => getStatusIds(state, { type: `account:${account?.id}:pinned`, prefix: 'account_timeline' }));
|
||||
const featuredStatusIds = useAppSelector(state => getStatusIds(state, { type: `account:${account?.id}:with_replies:pinned`, prefix: 'account_timeline' }));
|
||||
|
||||
const isBlocked = useAppSelector(state => state.relationships.getIn([account?.id, 'blocked_by']) === true);
|
||||
const unavailable = isBlocked && !features.blockersVisible;
|
||||
|
|
|
@ -352,12 +352,12 @@ const timelines = (state: State = initialState, action: AnyAction) => {
|
|||
}));
|
||||
case PIN_SUCCESS:
|
||||
return state.updateIn(
|
||||
[`account:${action.accountId}:pinned`, 'items'],
|
||||
[`account:${action.accountId}:with_replies:pinned`, 'items'],
|
||||
ids => ImmutableOrderedSet([action.statusId]).union(ids as ImmutableOrderedSet<string>),
|
||||
);
|
||||
case UNPIN_SUCCESS:
|
||||
return state.updateIn(
|
||||
[`account:${action.accountId}:pinned`, 'items'],
|
||||
[`account:${action.accountId}:with_replies:pinned`, 'items'],
|
||||
ids => (ids as ImmutableOrderedSet<string>).delete(action.statusId),
|
||||
);
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue