This commit is contained in:
mgabdev
2020-05-06 00:33:54 -04:00
parent 01bb440385
commit e1e26afe11
23 changed files with 501 additions and 292 deletions

View File

@@ -80,11 +80,13 @@ const makeMapStateToProps = () => {
username: username,
})
let fetchedContext = false
let descendantsIds = ImmutableList()
let ancestorStatus
let fetchedContext = false
if (status && status.get('in_reply_to_account_id')) {
//
if (status && status.get('in_reply_to_account_id') && !props.isChild) {
fetchedContext = true
let inReplyTos = state.getIn(['contexts', 'inReplyTos'])
@@ -100,12 +102,16 @@ const makeMapStateToProps = () => {
})
const ancestorStatusId = ancestorsIds.get(0)
ancestorStatus = getStatus(state, {
id: ancestorStatusId,
})
descendantsIds = getDescendants(state, ancestorStatus, statusId)
if (ancestorStatusId !== statusId) {
ancestorStatus = getStatus(state, {
id: ancestorStatusId,
})
descendantsIds = getDescendants(state, ancestorStatus, statusId)
}
}
//
if (status && status.get('replies_count') > 0 && !fetchedContext) {
descendantsIds = getDescendants(state, status)
}