From 29c865dbc801246ecd626c985f0159c9bdeabbf4 Mon Sep 17 00:00:00 2001 From: Z Date: Wed, 15 Jan 2020 17:32:30 +0800 Subject: [PATCH] fix bugs --- app/javascript/mastodon/features/status/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js index 6eda8d7eb..51d32291f 100644 --- a/app/javascript/mastodon/features/status/index.js +++ b/app/javascript/mastodon/features/status/index.js @@ -151,8 +151,15 @@ const makeMapStateToProps = () => { 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! 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; }