Browse Source

fix bugs

pull/4/head
欧醚 4 years ago
parent
commit
29c865dbc8
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      app/javascript/mastodon/features/status/index.js

+ 9
- 2
app/javascript/mastodon/features/status/index.js View File

@ -151,8 +151,15 @@ const makeMapStateToProps = () => {
ancestorsIds = getAncestorsIds(state, { id: status.get('in_reply_to_id') }); ancestorsIds = getAncestorsIds(state, { id: status.get('in_reply_to_id') });
const root_status = ancestorsIds.size? getStatus(state, {id: ancestorsIds.get(0)}) : status; //error is directly visit url of non-root detailedStatus, feature! const root_status = ancestorsIds.size? getStatus(state, {id: ancestorsIds.get(0)}) : status; //error is directly visit url of non-root detailedStatus, feature!
rootAcct = root_status? root_status.getIn(['account', 'acct']) : -1; rootAcct = root_status? root_status.getIn(['account', 'acct']) : -1;
descendantsIds = rootAcct == '0' ? state.getIn(['contexts', 'replies', status.get('id')]).reverse() : getDescendantsIds(state, { id: status.get('id') });
deep = rootAcct == '0' ? ancestorsIds.size : null;
if(rootAcct == '0') {
descendantsIds = state.getIn(['contexts', 'replies', status.get('id')]);
if(descendantsIds)
descendantsIds = descendantsIds.reverse();
}
else {
descendantsIds = getDescendantsIds(state, { id: status.get('id') });
}
deep = rootAcct == '0' ? ancestorsIds.size : null;
treeData = rootAcct == '0' ? getTreeData(state, {id: status.get('id')}) : null; treeData = rootAcct == '0' ? getTreeData(state, {id: status.get('id')}) : null;
} }

Loading…
Cancel
Save